Add /data, /tag and NBT summoning

/data now supports get, merge, modify and remove on entities, block entities and command storage, with NBT paths (children, indices, [] and [{...}] matches, root matches), scaling for numeric reads, the append, prepend, insert, set and merge modifiers, and from, string and value sources. Command storage is saved per namespace in data/<namespace>/command_storage.dat. /tag adds, removes and lists entity tags, which selectors' tag=, nbt= and advancements= options now check. /summon accepts a full NBT compound (custom name, tags, health, NoAI, Invulnerable, item contents and so on), and armor stands, item frames, paintings, boats and minecarts can now be selected, teleported and killed like other entities.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Ludovic Marie
2026-10-09 13:01:12 +02:00
parent 2872884cb9
commit d5d87f23a2
19 changed files with 2885 additions and 34 deletions
+5 -4
View File
@@ -11,19 +11,19 @@ use crate::gamerules::{RULES, Value};
pub const ALL: u8 = 0;
pub const GAMEMASTERS: u8 = 2;
const PLAYERS: ArgType = ArgType::Entity {
pub const PLAYERS: ArgType = ArgType::Entity {
single: false,
players: true,
};
const PLAYER: ArgType = ArgType::Entity {
pub const PLAYER: ArgType = ArgType::Entity {
single: true,
players: true,
};
const ENTITIES: ArgType = ArgType::Entity {
pub const ENTITIES: ArgType = ArgType::Entity {
single: false,
players: false,
};
const ENTITY: ArgType = ArgType::Entity {
pub const ENTITY: ArgType = ArgType::Entity {
single: true,
players: false,
};
@@ -343,6 +343,7 @@ pub fn build() -> Dispatcher {
d.executes(fade_out, "title");
super::tree_scoreboard::register(&mut d, root);
super::tree_data::register(&mut d, root);
execute(&mut d, root);
d
}