Singular entities
pig: entity = @e[type=minecraft:pig]
Braces are not required around a selector. A singular entity uses limit-one selection and replaces the previous variable tag whenever it is assigned.
DATACRAFT V2
Entity values connect typed variables to Minecraft selectors without repeatedly storing large selectors in commands.
pig: entity = @e[type=minecraft:pig]
Braces are not required around a selector. A singular entity uses limit-one selection and replaces the previous variable tag whenever it is assigned.
The runtime registers the currently executing entity, gives it a generated namespace tag, and stores its UUID in an entity object. This lets an entity survive storage in lists and function calls.
pigs: set[entity] = @e[type=minecraft:pig]
An entity set is a generated tag shared by every member. Union, intersection, insertion, removal, membership, and iteration operate directly on tags.
When an entity value is interpolated into a raw command, DataCraft emits an appropriate tag selector. Runtime helpers centralize common register, resolve, retag, and cleanup operations.
Use uuid: list[int] = target["UUID"] to read the entity's four-integer UUID. Other NBT lists can use a compatible typed list such as effects: list[nbt] = target["active_effects"]. Scalar and nested paths use int, bool, str, or nbt. Fields are writable with assignments such as target["Health"] = 10 and target["Brain"]["memories"] = data. Property access such as target.UUID is not supported.