<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.sasgaming.net/index.php?action=history&amp;feed=atom&amp;title=Minecraft%3AData_component_predicate</id>
	<title>Minecraft:Data component predicate - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.sasgaming.net/index.php?action=history&amp;feed=atom&amp;title=Minecraft%3AData_component_predicate"/>
	<link rel="alternate" type="text/html" href="https://wiki.sasgaming.net/index.php?title=Minecraft:Data_component_predicate&amp;action=history"/>
	<updated>2026-09-30T00:05:35Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://wiki.sasgaming.net/index.php?title=Minecraft:Data_component_predicate&amp;diff=210853&amp;oldid=prev</id>
		<title>SyncBot: Sync: new page from Minecraft</title>
		<link rel="alternate" type="text/html" href="https://wiki.sasgaming.net/index.php?title=Minecraft:Data_component_predicate&amp;diff=210853&amp;oldid=prev"/>
		<updated>2026-09-21T11:08:45Z</updated>

		<summary type="html">&lt;p&gt;Sync: new page from Minecraft&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{exclusive|java}}&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Data component predicates&amp;#039;&amp;#039;&amp;#039; (historically known as &amp;#039;&amp;#039;&amp;#039;item sub-predicates&amp;#039;&amp;#039;&amp;#039;) are used to check conditions about [[Minecraft:data component]]s. They are used in &amp;lt;code&amp;gt;minecraft:item_predicate&amp;lt;/code&amp;gt; [[Minecraft:argument types|argument type]], [[Minecraft:item modifier]]s, [[Minecraft:Predicate|loot predicate]]s, [[Minecraft:Advancement_definition|advancement criteria]], and entity and block [[Minecraft:predicate]]s. They return a pass or fail result to the invoker, who acts differently based on this result.&lt;br /&gt;
&lt;br /&gt;
== List of data component predicate types ==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable mw-collapsible&amp;quot;&lt;br /&gt;
! ID !! Data type and format !! [[Minecraft:Data component]]s to check&lt;br /&gt;
|-&lt;br /&gt;
| attribute_modifiers || {{nbt|compound|Object}}, see [[#attribute_modifiers|below]] || &amp;lt;code&amp;gt;attribute_modifiers&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bundle_contents || {{nbt|compound|Object}}, see [[#bundle_contents|below]] || &amp;lt;code&amp;gt;bundle_contents&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| container || {{nbt|compound|Object}}, see [[#container|below]] || &amp;lt;code&amp;gt;container&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| custom_data || {{nbt|string|String}} or {{nbt|compound|Object}}, see [[#custom_data|below]] || &amp;lt;code&amp;gt;custom_data&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| damage || {{nbt|compound|Object}}, see [[#damage|below]] || &amp;lt;code&amp;gt;damage&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;max_damage&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| enchantments || {{nbt|list|Array}}, see [[#enchantments|below]] || &amp;lt;code&amp;gt;enchantments&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| firework_explosion || {{nbt|compound|Object}}, see [[#firework_explosion|below]] || &amp;lt;code&amp;gt;firework_explosion&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| fireworks || {{nbt|compound|Object}}, see [[#fireworks|below]] || &amp;lt;code&amp;gt;fireworks&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| jukebox_playable || {{nbt|compound|Object}}，see [[#jukebox_playable|below]] || &amp;lt;code&amp;gt;jukebox_playable&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| potion_contents || {{nbt|string|String}} or {{nbt|list|Array}}, see [[#potion_contents|below]] || &amp;lt;code&amp;gt;potion_contents&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| stored_enchantments || {{nbt|list|Array}}, see [[#stored_enchantments|below]] || &amp;lt;code&amp;gt;stored_enchantments&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| trim || {{nbt|compound|Object}}, see [[#trim|below]] || &amp;lt;code&amp;gt;trim&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| writable_book_content || {{nbt|compound|Object}}, see [[#writable_book_content|below]] || &amp;lt;code&amp;gt;writable_book_content&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| written_book_content || {{nbt|compound|Object}}, see [[#written_book_content|below]] ||| &amp;lt;code&amp;gt;written_book_content&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Formats ==&lt;br /&gt;
=== attribute_modifiers ===&lt;br /&gt;
Checks modifiers in the &amp;lt;code&amp;gt;[[Minecraft:Data component#attribute_modifiers|attribute_modifiers]]&amp;lt;/code&amp;gt; data component.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;treeview&amp;quot;&amp;gt;&lt;br /&gt;
* {{nbt|compound|minecraft:attribute_modifiers}}&lt;br /&gt;
** {{nbt|compound|modifiers}}: (Optional) A collection predicate of [[Minecraft:attribute modifier]].&lt;br /&gt;
*** {{:Item_sub-predicate/collection predicate|attribute modifier|attribute modifier}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== bundle_contents ===&lt;br /&gt;
Checks item stacks in the &amp;lt;code&amp;gt;[[Minecraft:Data component#bundle_contents|bundle_contents]]&amp;lt;/code&amp;gt; data component.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;treeview&amp;quot;&amp;gt;&lt;br /&gt;
* {{nbt|compound|minecraft:bundle_contents}}&lt;br /&gt;
** {{nbt|compound|items}}: (Optional) A collection predicate of item stack.&lt;br /&gt;
*** {{:Item_sub-predicate/collection predicate|item stack|conditions/item}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== container ===&lt;br /&gt;
Checks item stacks in the &amp;lt;code&amp;gt;[[Minecraft:Data component#container|container]]&amp;lt;/code&amp;gt; data component.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;treeview&amp;quot;&amp;gt;&lt;br /&gt;
* {{nbt|compound|minecraft:container}}&lt;br /&gt;
** {{nbt|compound|items}}: (Optional) A collection predicate of item stack.&lt;br /&gt;
*** {{:Item_sub-predicate/collection predicate|item stack|conditions/item}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== custom_data ===&lt;br /&gt;
Checks &amp;lt;code&amp;gt;[[Minecraft:Data component#custom_data|custom_data]]&amp;lt;/code&amp;gt; data component. See {{slink|NBT format|Testing NBT tags}} and {{slink|NBT format|Conversion from JSON}}.&lt;br /&gt;
&lt;br /&gt;
Either as a JSON object or an NBT compound tag, or a string. If a string, it is resolved into an NBT compound tag.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;treeview&amp;quot;&amp;gt;&lt;br /&gt;
* {{nbt|string}}{{nbt|compound|minecraft:custom_data}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== damage ===&lt;br /&gt;
Checks [[Minecraft:durability|remaining durability or damage value]]. Damage value is from the &amp;lt;code&amp;gt;[[Minecraft:Data component#damage|damage]]&amp;lt;/code&amp;gt; data component; remaining durability is the value &amp;lt;code&amp;gt;[[Minecraft:Data component#max_damage|max_damage]]&amp;lt;/code&amp;gt; data component minus damage value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;treeview&amp;quot;&amp;gt;&lt;br /&gt;
* {{nbt|compound|minecraft:damage}}&lt;br /&gt;
** {{nbt|int|damage}}: (Optional) Checks damage value. Matches an exact {{nbt|int}}value, or checks if the value is between a range.&lt;br /&gt;
** {{nbt|compound|damage}}: (Optional) Another format.&lt;br /&gt;
*** {{nbt|int|max}}: (Optional) The maximum value.&lt;br /&gt;
*** {{nbt|int|min}}: (Optional) The minimum value.&lt;br /&gt;
** {{nbt|int|durability}}: (Optional) Checks remaining durability. Matches an exact {{nbt|int}}value, or checks if the value is between a range.&lt;br /&gt;
** {{nbt|compound|durability}}: (Optional) Another format.&lt;br /&gt;
*** {{nbt|int|max}}: (Optional) The maximum value.&lt;br /&gt;
*** {{nbt|int|min}}: (Optional) The minimum value.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== enchantments ===&lt;br /&gt;
Checks enchantments on the item (enchantments in the &amp;lt;code&amp;gt;[[Minecraft:Data component#enchantments|enchantments]]&amp;lt;/code&amp;gt; data component).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;treeview&amp;quot;&amp;gt;&lt;br /&gt;
* {{nbt|list|minecraft:enchantments}}: Array of conditions. The sub-predicate succeeds when all the conditions succeed. &lt;br /&gt;
** {{nbt|compound}}: A condition.&lt;br /&gt;
*** {{nbt|string}}{{nbt|list|enchantments}}: (Optional) {{json ref/enchantment|tag=1}}. If more than one enchantment is specified, succeeds when any one of them is present.&lt;br /&gt;
*** {{nbt|int|levels}}: (Optional) Checks the level of the specified enchantment. Matches an exact {{nbt|int}}value, or checks if the value is between a range. If more than one enchantment is specified, succeeds when any one of them matches the level. If {{nbt|string}}{{nbt|list|enchantment}} is not specified, succeeds when any one of enchantments on the item matches the level.&lt;br /&gt;
*** {{nbt|compound|levels}}: (Optional) Another format.&lt;br /&gt;
**** {{nbt|int|max}}: (Optional) The maximum value.&lt;br /&gt;
**** {{nbt|int|min}}: (Optional) The minimum value.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== firework_explosion ===&lt;br /&gt;
Checks the &amp;lt;code&amp;gt;[[Minecraft:Data component#firework_explosion|firework_explosion]]&amp;lt;/code&amp;gt; data component.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;treeview&amp;quot;&amp;gt;&lt;br /&gt;
* {{nbt|compound|minecraft:firework_explosion}}&lt;br /&gt;
** {{Nbt inherit/firework predicate}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== fireworks ===&lt;br /&gt;
Checks explosion effects in the &amp;lt;code&amp;gt;[[Minecraft:Data component#fireworks|fireworks]]&amp;lt;/code&amp;gt; data component.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;treeview&amp;quot;&amp;gt;&lt;br /&gt;
* {{nbt|compound|minecraft:fireworks}}&lt;br /&gt;
** {{nbt|compound|explosions}}: (Optional) A collection predicate of explosion effect.&lt;br /&gt;
*** {{:Item_sub-predicate/collection predicate|explosion effect|firework predicate}}&lt;br /&gt;
** {{nbt|int|flight_duration}}: (Optional) Checks the flight duration of this firework rocket, i.e. the number of gunpowders used to craft it. Matches an exact {{nbt|int}}value, or checks if the value is between a range.&lt;br /&gt;
** {{nbt|compound|flight_duration}}: (Optional) Another format.&lt;br /&gt;
*** {{nbt|int|max}}: (Optional) The maximum value.&lt;br /&gt;
*** {{nbt|int|min}}: (Optional) The minimum value.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== jukebox_playable ===&lt;br /&gt;
Checks jukebox song in the &amp;lt;code&amp;gt;[[Minecraft:Data component#jukebox_playable|jukebox_playable]]&amp;lt;/code&amp;gt; data component.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;treeview&amp;quot;&amp;gt;&lt;br /&gt;
* {{nbt|compound|minecraft:jukebox_playable}}&lt;br /&gt;
** {{nbt|string}}{{nbt|list|song}}: (Optional) {{json ref|jukebox song|tag=1}}. If more than one jukebox song is specified, succeeds when any one of them matches the testing song.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== potion_contents ===&lt;br /&gt;
Checks {{nbt|string|potion}} field in the &amp;lt;code&amp;gt;[[Minecraft:Data component#potion_contents|potion_contents]]&amp;lt;/code&amp;gt; data component. Fails if there is no {{nbt|string|potion}} field in the component.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;treeview&amp;quot;&amp;gt;&lt;br /&gt;
* {{nbt|string}}{{nbt|list|minecraft:potion_contents}}: {{json ref|potion type|Potion#Item_data|tag=1}}. If more than one potion type is specified, succeeds when any one of them matches the testing {{nbt|string|potion}} field.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== stored_enchantments ===&lt;br /&gt;
Checks enchantments on an enchanted book (enchantments in the &amp;lt;code&amp;gt;[[Minecraft:Data component#stored_enchantments|stored_enchantments]]&amp;lt;/code&amp;gt; data component).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;treeview&amp;quot;&amp;gt;&lt;br /&gt;
* {{nbt|list|minecraft:stored_enchantments}}: Array of conditions. The sub-predicate successes when all the conditions succeed. &lt;br /&gt;
** {{nbt|compound}}: A condition.&lt;br /&gt;
*** {{nbt|string}}{{nbt|list|enchantments}}: (Optional) {{json ref/enchantment|tag=1}}. If more than one enchantment is specified, succeeds when any one of them is present.&lt;br /&gt;
*** {{nbt|int|levels}}: (Optional) Checks the level of the specified enchantment. Matches an exact {{nbt|int}}value, or checks if the value is between a range. If more than one enchantment is specified, succeeds when any one of them matches the level. If {{nbt|string}}{{nbt|list|enchantment}} is not specified, succeeds when any one of enchantments on the item matches the level.&lt;br /&gt;
*** {{nbt|compound|levels}}: (Optional) Another format.&lt;br /&gt;
**** {{nbt|int|max}}: (Optional) The maximum value.&lt;br /&gt;
**** {{nbt|int|min}}: (Optional) The minimum value.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== trim ===&lt;br /&gt;
Checks the &amp;lt;code&amp;gt;[[Minecraft:Data component#trim|trim]]&amp;lt;/code&amp;gt; data component.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;treeview&amp;quot;&amp;gt;&lt;br /&gt;
* {{nbt|compound|minecraft:trim}}&lt;br /&gt;
** {{nbt|list}}{{nbt|string|material}}: (Optional) {{json ref|trim material|tag=1}} If more than one trim material is specified, succeeds when any one of them matches the testing trim material.&lt;br /&gt;
** {{nbt|list}}{{nbt|string|pattern}}: (Optional) {{json ref|trim pattern|tag=1}} If more than one trim pattern is specified, succeeds when any one of them matches the testing trim pattern.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== writable_book_content ===&lt;br /&gt;
Checks pages in the &amp;lt;code&amp;gt;[[Minecraft:Data component#writable_book_content|writable_book_content]]&amp;lt;/code&amp;gt; data component. Raw texts are checked instead of filtered texts.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;treeview&amp;quot;&amp;gt;&lt;br /&gt;
* {{nbt|compound|minecraft:writable_book_content}}&lt;br /&gt;
** {{nbt|compound|pages}}: (Optional) A collection predicate of page.&lt;br /&gt;
*** {{:Item_sub-predicate/collection predicate|page|Matches the full string of a page|string}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== written_book_content ===&lt;br /&gt;
Checks &amp;lt;code&amp;gt;[[Minecraft:Data component#written_book_content|written_book_content]]&amp;lt;/code&amp;gt; data component.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;treeview&amp;quot;&amp;gt;&lt;br /&gt;
* {{nbt|compound|minecraft:written_book_content}}&lt;br /&gt;
** {{nbt|compound|pages}}: (Optional) A collection predicate of page. Checks the raw texts of pages instead of filtered texts.&lt;br /&gt;
*** {{:Item_sub-predicate/collection predicate|page|A [[Minecraft:text component]]. Matches the full text of a page|any}}&lt;br /&gt;
** {{nbt|string|author}}: (Optional) Matches the full string of author.&lt;br /&gt;
** {{nbt|string|title}}: (Optional) Matches the full string of title. Checks raw title instead of filtered title.&lt;br /&gt;
** {{nbt|int|generation}}: (Optional) Checks the number of times this written book has been copied. 0 = original, 1 = copy of original, 2 = copy of copy, 3 = tattered. Matches an exact {{nbt|int}}value, or checks if the value is between a range.&lt;br /&gt;
** {{nbt|compound|generation}}: (Optional) Another format.&lt;br /&gt;
*** {{nbt|int|max}}: (Optional) The maximum value.&lt;br /&gt;
*** {{nbt|int|min}}: (Optional) The minimum value.&lt;br /&gt;
** {{nbt|boolean|resolved}}: (Optional) Checks whether the JSON text components have already been resolved (the {{nbt|bool|resolved}} field in the data component is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;).&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
{{HistoryTable&lt;br /&gt;
|{{HistoryLine|java}}&lt;br /&gt;
|{{HistoryLine||1.20.5|dev=24w11a|Added item sub-predicates.}}&lt;br /&gt;
|{{HistoryLine|||dev=24w12a|Item sub-predicates can now be used in the &amp;lt;code&amp;gt;minecraft:item_predicate&amp;lt;/code&amp;gt; [[Minecraft:argument types|argument type]].&lt;br /&gt;
|&amp;lt;code&amp;gt;custom_data&amp;lt;/code&amp;gt; now can be defined as a JSON object or NBT compound tag. Before, it could only be defined as an SNBT string.}}&lt;br /&gt;
|{{HistoryLine|||dev=pre1|Added 8 new item sub-predicate types: {{cd|d=and|container|bundle_contents|firework_explosion|fireworks|writable_book_content|written_book_content|attribute_modifiers|trim}}.}}&lt;br /&gt;
|{{HistoryLine||1.21|dev=24w18a|In &amp;lt;code&amp;gt;enchantments&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;stored_enchantments&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;enchantment&amp;lt;/code&amp;gt; field is replaced by &amp;lt;code&amp;gt;enchantments&amp;lt;/code&amp;gt;, and now can specify multiple enchantments.}}&lt;br /&gt;
|{{HistoryLine|||dev=24w21a|Added a new item sub-predicate type {{cd|jukebox_playable}}.&lt;br /&gt;
|In &amp;lt;code&amp;gt;attribute_modifiers&amp;lt;/code&amp;gt;, {{cd|d=and|name|uuid}} fields are replaced by &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt;.}}&lt;br /&gt;
|{{HistoryLine||1.21.5|dev=25w04a|Renamed item sub-predicates to &amp;quot;data component predicates.&amp;quot;}}&lt;br /&gt;
|{{HistoryLine|||dev=25w10a|Data component predicates are now usable from block and entity predicates.}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Navigation ==&lt;br /&gt;
{{Navbox Java Edition technical|general}}&lt;br /&gt;
&lt;br /&gt;
[[Minecraft:de:Gegenstands-Unterprädikate]]&lt;br /&gt;
[[Minecraft:fr:Prédicat de composant de données]]&lt;br /&gt;
[[Minecraft:ja:データコンポーネントプレディケート]]&lt;br /&gt;
[[Minecraft:pt:Predicado de componente de dado]]&lt;br /&gt;
[[Minecraft:zh:数据组件谓词]]&lt;/div&gt;</summary>
		<author><name>SyncBot</name></author>
	</entry>
</feed>