Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Minecraft:Data component predicate

From SAS Gaming Wiki
Revision as of 11:08, 21 September 2026 by SyncBot (talk | contribs) (Sync: new page from Minecraft)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Template:Exclusive Data component predicates (historically known as item sub-predicates) are used to check conditions about Minecraft:data components. They are used in minecraft:item_predicate argument type, Minecraft:item modifiers, loot predicates, advancement criteria, and entity and block Minecraft:predicates. They return a pass or fail result to the invoker, who acts differently based on this result.

List of data component predicate types

ID Data type and format Minecraft:Data components to check
attribute_modifiers Template:Nbt, see below attribute_modifiers
bundle_contents Template:Nbt, see below bundle_contents
container Template:Nbt, see below container
custom_data Template:Nbt or Template:Nbt, see below custom_data
damage Template:Nbt, see below damage and max_damage
enchantments Template:Nbt, see below enchantments
firework_explosion Template:Nbt, see below firework_explosion
fireworks Template:Nbt, see below fireworks
jukebox_playable Template:Nbt,see below jukebox_playable
potion_contents Template:Nbt or Template:Nbt, see below potion_contents
stored_enchantments Template:Nbt, see below stored_enchantments
trim Template:Nbt, see below trim
writable_book_content Template:Nbt, see below writable_book_content
written_book_content Template:Nbt, see below written_book_content

Formats

attribute_modifiers

Checks modifiers in the attribute_modifiers data component.

bundle_contents

Checks item stacks in the bundle_contents data component.

container

Checks item stacks in the container data component.

custom_data

Checks custom_data data component. See Template:Slink and Template:Slink.

Either as a JSON object or an NBT compound tag, or a string. If a string, it is resolved into an NBT compound tag.

damage

Checks remaining durability or damage value. Damage value is from the damage data component; remaining durability is the value max_damage data component minus damage value.

enchantments

Checks enchantments on the item (enchantments in the enchantments data component).

firework_explosion

Checks the firework_explosion data component.

fireworks

Checks explosion effects in the fireworks data component.

jukebox_playable

Checks jukebox song in the jukebox_playable data component.

potion_contents

Checks Template:Nbt field in the potion_contents data component. Fails if there is no Template:Nbt field in the component.

stored_enchantments

Checks enchantments on an enchanted book (enchantments in the stored_enchantments data component).

trim

Checks the trim data component.

writable_book_content

Checks pages in the writable_book_content data component. Raw texts are checked instead of filtered texts.

written_book_content

Checks written_book_content data component.

History

Template:HistoryTable

Navigation

Template:Navbox Java Edition technical

Minecraft:de:Gegenstands-Unterprädikate Minecraft:fr:Prédicat de composant de données Minecraft:ja:データコンポーネントプレディケート Minecraft:pt:Predicado de componente de dado Minecraft:zh:数据组件谓词