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

Minecraft:Hardcoded item properties (Java Edition): Difference between revisions

From SAS Gaming Wiki
SyncBot (talk | contribs)
Sync: updated from Minecraft
SyncBot (talk | contribs)
Sync: updated from Minecraft
 
(7 intermediate revisions by the same user not shown)
Line 1,081: Line 1,081:
* {{ItemLink|ink sac|InkSacItem|link=#InkSacItem}}
* {{ItemLink|ink sac|InkSacItem|link=#InkSacItem}}
* {{ItemLink|goat horn|InstrumentItem|link=#InstrumentItem}}
* {{ItemLink|goat horn|InstrumentItem|link=#InstrumentItem}}
* {{EntityLink|Item|Item|link=#Item (member access)}}
* {{EntityLink|Item|Item|link=#Item}}
* {{ItemLink|item frame|ItemFrameItem|link=#ItemFrameItem}}
* {{ItemLink|item frame|ItemFrameItem|link=#ItemFrameItem}}
* {{ItemLink|knowledge book|KnowledgeBookItem|link=#KnowledgeBookItem}}
* {{ItemLink|knowledge book|KnowledgeBookItem|link=#KnowledgeBookItem}}
Line 1,143: Line 1,143:
{{hatnote|Overrides method in [[#useOn(...)|{{jicp|}}]]}}
{{hatnote|Overrides method in [[#useOn(...)|{{jicp|}}]]}}


If the interaction involves clicking on the dowm side of a block, it fails.
If the interaction involves clicking on the bottom face of a block, it fails.


The target position for placing the [[Minecraft:armor stand]] is the bottom center of the block next to the interacted block, in the direction of the interacted face. The game simulates the [[Minecraft:hitbox]] of an armor stand in this position; if the hitbox collides with a block or intersects with an (no [[Minecraft:spectator]]) entity hitbox, the interaction fails.
The target position for placing the [[Minecraft:armor stand]] is the bottom center of the block next to the interacted block, in the direction of the interacted face. The game simulates the [[Minecraft:hitbox]] of an armor stand in this position; if the hitbox collides with a block or intersects with an entity hitbox (except [[Minecraft:spectator]]s), the interaction fails.


The game attempts to obtain the armor stand, based on the item's components {{DCL|custom_name}}, {{DCL|custom_data}}, and {{DCL|entity_data}}. If it cannot be generated, the interaction fails.
The game attempts to obtain the armor stand, based on the item's components {{DCL|custom_name}}, {{DCL|custom_data}}, and {{DCL|entity_data}}. If it cannot be generated, the interaction fails.


In case of the armor stand is generated, apply in the following order:
If the armor stand is generated, apply in the following order:
* the armor stand rotates 202.5° according to the player's rotation, but rounds its rotation down to some multiple of 45°;
* The armor stand rotates 202.5° according to the player's rotation, but rounds its rotation down to some multiple of 45°;
* the [[Minecraft:sound event]] armor stand place ({{cd|entity.armor_stand.place}}) is played;
* The [[Minecraft:sound event]] armor stand place ({{cd|entity.armor_stand.place}}) is played;
* produce the [[Minecraft:game event]] {{cd|entity_place}};  
* The [[Minecraft:game event]] {{cd|entity_place}} is produced;  
* shrink one item of the item stack.
* The item stack is shrunk by one.


The interaction returns success given no aforementioned fails occur.
The interaction returns success given no aforementioned fails occur.
Armor stand [[Minecraft:Armor_Stand#Entity_data|entity data]]:
<div class="treeview">
** {{nbt inherit/apply components from item stack}}
** {{nbt|string|id}}: {{cd|minecraft:armor_stand}}.
** {{nbt|list|Pos}}: The target position. Try moving up to one block down, looking for a collision box that connects with the armor support's hitbox. This attempt is made before applying the {{cd|dsds}} component.
** {{nbt|list|Rotation}}:
*** {{nbt|float}}: See above.
*** {{nbt|float}}: {{cd|0.0f}}.
** {{nbt||<''any tag''>}}: With the exception of '''id''', '''Rotation''', '''Passengers'''{{More info|There are more exceptions? See entity.load()}}, and '''UUID''', it can be defined by {{DCL|entity_data}}. The {{cd|entity_data}} only has an effect if the {{cd|entity_data.id}} is {{cd|minecraft:armor_stand}}. '''CustomName''', '''data''', and '''Pos''' have priority to be defined by component {{cd|entity_data}}.
</div>


=== ArrowItem ===
=== ArrowItem ===
{{Expand section}}
{{Infobox hip|class=ArrowItem|Arrow|Spectral Arrow|Tipped Arrow|impts={{cd|ProjectileItem}}||impns=
{{Infobox hip|class=ArrowItem|Arrow|Spectral Arrow|Tipped Arrow|impts={{cd|ProjectileItem}}||impns=
*{{slink||SpectralArrowItem}}
*{{slink||SpectralArrowItem}}
Line 1,166: Line 1,177:
'''createArrow({{Tooltip|...|Level level, ItemStack itemStack, LivingEntity owner, ItemStack firedFromWeapon}})'''
'''createArrow({{Tooltip|...|Level level, ItemStack itemStack, LivingEntity owner, ItemStack firedFromWeapon}})'''


Creates an {{cd|AbstractArrow}} projectile entity from the item.
Used by {{cd|createProjectile}} in {{slink||ProjectileWeaponItem}}, and by [[Minecraft:skeleton]]s and [[Minecraft:illusioner]]s via {{slink||ProjectileUtil}}.
For regular arrows, creates an [[Minecraft:Arrow#Entity data|arrow projectile]] with:
{{-}}
<div class="treeview">
** {{nbt inherit/apply components from item stack}}
** {{nbt|string|id}}: {{cd|minecraft:arrow}}.
** {{nbt|list|Pos}}:
*** {{nbt|double}}: Owner's X coordinate.
*** {{nbt|double}}: Owner's eye Y coordinate minus {{cd|0.1}}.
*** {{nbt|double}}: Owner's Z coordinate.
** {{nbt|compound|item}}: The ''item stack'' copy, with count 1.
** {{nbt|compound|weapon}}: The ''fired from weapon'' copy, if it exists.
** {{nbt|byte|PierceLevel}}: According to the [[Minecraft:Enchantment_definition#Effect components|effect components]] {{cd|projectile_piercing}} of the weapon enchantments, if it exists. The ''item stack'' can be used for requirements.
** {{nbt|byte|pickup}}: {{cd|2b}} (creative only) if the item has the component {{DCL|intangible_projectile}}, {{cd|1b}} (allowed) otherwise.
** {{nbt|int array|Owner}}: The ''owner'' [[Minecraft:UUID]].
</div>


'''asProjectile({{Tooltip|...|Level level, Position position, ItemStack itemStack, Direction direction}})'''
'''asProjectile({{Tooltip|...|Level level, Position position, ItemStack itemStack, Direction direction}})'''
{{hatnote|Overrides method in {{cd|{{jicp|Projectile}}}}}}
Creates an arrow projectile not fired from any weapon, used by [[Minecraft:dispenser]]s and [[Minecraft:ominous item spawner]]s, with:


{{-}}
{{-}}
<div class="treeview">
** {{nbt inherit/apply components from item stack}}
** {{nbt|string|id}}: {{cd|minecraft:arrow}}.
** {{nbt|list|Pos}}: The ''position''.
** {{nbt|compound|item}}: The ''item stack'' copy, with count 1.
** {{nbt|byte|pickup}}: {{cd|1b}} (allowed), regardless of {{DCL|intangible_projectile}}.
</div>


=== AxeItem ===
=== AxeItem ===
Line 1,181: Line 1,221:
{{-}}
{{-}}
=== BannerItem ===
=== BannerItem ===
{{Expand section}}
{{Infobox hip|class=BannerItem|Items={{ItemLink|Banner|id=Banners}} (ColorCollection)|ext=  
{{Infobox hip|class=BannerItem|Items={{ItemLink|Banner|id=Banners}} (ColorCollection)|ext=  
{{Slink||StandingAndWallBlockItem}} ({{Slink||BlockItem}} )}}  
{{Slink||StandingAndWallBlockItem}} ({{Slink||BlockItem}} )}}  


'''getColor()'''
'''getColor()'''
Used by the [[Minecraft:Recipe_(Java_Edition)#crafting_special_*|{{cd|crafting_special_bannerduplicate}}]] recipe type to determine whether the banner colors match, and by the [[Minecraft:Recipe_(Java_Edition)#crafting_special_*|{{cd|crafting_special_shielddecoration}}]] recipe type to set the {{DCL|base_color}} of the shield.
This is done by calling the {{cd|getColor}} method of {{cd|AbstractBannerBlock}} on the item's block form, and as such the block forms of a {{cd|BannerItem}} must extend {{cd|AbstractBannerBlock}}.


{{-}}
{{-}}
Line 1,316: Line 1,359:


=== BoatItem ===
=== BoatItem ===
{{empty section}}
{{Infobox hip|class=BoatItem|Boats}}
 
'''use({{Tooltip|...|Level level, Player player, InteractionHand hand}})'''
{{hatnote|Overrides method in [[#use(...)|{{jicp|}}]] }}
 
Checks if the player is looking at a block (including fluids) and passes if not. Then checks if any pickable entities' pick hitboxes contain the player's eye position and passes if so.
 
Then tries to create a boat entity with a type hardcoded for each item ID at the block targeted and fails if the entity cannot be created. If it is spawned, its yaw rotation is set to the player's yaw rotation. Then fails if the boat is intersecting anything except fluid.
 
Finally, adds the boat to the world, produces an {{cd|entity_place}} [[Minecraft:game event]], consumes one item from the stack, adds to the item used statistic, and succeeds.
 
{{-}}
 
=== BoneMealItem ===
=== BoneMealItem ===
{{empty section}}
{{Infobox hip|class=BoneMealItem|Bone Meal}}
=== BottleItem ===
 
{{empty section}}
All the behavior of bone meal is hardcoded in this class.
=== BowItem ===
 
{{empty section}}
'''useOn({{Tooltip|...|UseOnContext context}})'''
{{hatnote|Overrides method in [[#useOn(...)|{{jicp|}}]] }}
 
First calls {{cd|growCrop}}. If it returns {{cd|true}}, the interaction succeeds, the stack shrinks by one, [[Minecraft:Java_Edition_protocol/Packets#World_Event|world event]] 1505 (bone meal particles and sound) is caused, and an {{cd|item_interact_finish}} [[Minecraft:game event]] is produced.
 
Otherwise, checks if a full solid face was clicked (passing if not) and calls {{cd|growWaterPlant}}, succeeding as described above if it returns {{cd|true}}. If it returns {{cd|false}}, the interaction passes.
 
'''growCrop({{Tooltip|...|ItemStack itemStack, Level level, BlockPos pos}})'''
 
Tries to bone meal a {{cd|{{jcp|net.minecraft.world.level.block.BonemealableBlock|BonemealableBlock}}}}. If it is valid, regardless of whether it succeeds, returns {{cd|true}} (otherwise returns {{cd|false}}).
 
Also used by [[Minecraft:dispenser]]s and {{slink||UseBonemeal}}.
 
'''growWaterPlant({{Tooltip|...|ItemStack itemStack, Level level, BlockPos pos, Direction clickedFace}})'''
 
Attempts to grow plants underwater, defaulting to [[Minecraft:seagrass]]. Returns {{cd|false}} if the block next to the clicked face is not a full water block, and {{cd|true}} otherwise.
 
If used in a biome in {{Tag link|biome|produces_corals_from_bonemeal}}, the block next to the clicked face is replaced with a random block in {{Tag link|block|wall_corals}} if a side face was clicked, and other seagrass blocks that would be placed have a 1/4 chance of being replaced with random blocks from {{Tag link|block|underwater_bonemeals}}.
 
Also used by [[Minecraft:dispenser]]s.
 
{{-}}
 
=== BottleItem ===
{{Infobox hip|class=BottleItem|Glass Bottle}}
 
'''use({{Tooltip|...|Level level, Player player, InteractionHand hand}})'''
{{hatnote|Overrides method in [[#use(...)|{{jicp|}}]] }}
 
First checks for [[Minecraft:area effect cloud]]s owned by an [[Minecraft:ender dragon]] (i.e. dragon's breath) within 2 blocks of the player's hitbox. If there is at least one, picks one and reduces its radius by 0.5, plays the {{cd|item.bottle.fill_dragonbreath}} sound event, produces a {{cd|fluid_pickup}} game event, triggers the {{cd|player_interacted_with_entity}} advancement trigger, transforms a bottle (or all of them, if the player is in Creative mode) into [[Minecraft:dragon's breath]], and succeeds.
 
If there is not any dragon's breath, checks if the player is interacting with water (passing otherwise) and plays the {{cd|item.bottle.fill}} sound event, produces a {{cd|fluid_pickup}} game event, transforms a bottle (or all of them) into a [[Minecraft:water bottle]], and succeeds.
 
{{-}}
 
=== BowItem ===
{{empty section}}
=== BrushItem ===
=== BrushItem ===
{{empty section}}
{{empty section}}
Line 1,330: Line 1,421:
{{empty section}}
{{empty section}}
=== CompassItem ===
=== CompassItem ===
{{empty section}}
{{Infobox hip|class=CompassItem|Compass}}
=== CrossbowItem ===
{{empty section}}
=== CushionItem ===
{{In development|je||26.3|section=1|note=Class add in [[Minecraft:26.3-snap3]].}}
{{Infobox hip|class=CushionItem|Items={{ItemLink|Cushion|id=Cushions}} (ColorCollection)}}  


'''useOn({{tooltip|...|UseOnContext context}})'''
'''isFoil({{Tooltip|...|ItemStack itemStack}})'''
{{hatnote|Overrides method in [[#useOn(...)|{{jicp|}}]]}}
{{hatnote|Overrides method in [[#isFoil(...)|{{jicp|}}]] }}


Position the cushion. Method partially described in {{slink|Cushion|Placement}}.
Overridden to {{cd|true}} if this stack has the {{DCL|lodestone_tracker}} component.


The interaction fails if the clicked face is not the up fece. Otherwise, summon an Axis-Aligned Bounding Box (AABB) with size of a cushion's hitbox (16×4×16 pixels), the X and Z axes centered on the interlocking block, and the minimum of the Y-axis at the clicked position.
'''inventoryTick({{Tooltip|...|ItemStack itemStack, ServerLevel level, Entity owner, EquipmentSlot slot}})'''
{{hatnote|Overrides method in [[#inventoryTick(...)|{{jicp|}}]] }}


If a cushion cannot survive in the AABB block ({{jcp|net.minecraft.world.entity.decoration.Cushion}}.{{cd|wouldSuriveAt(level, spawnAABB)}}), the interaction fails. The test consists of invoking a new AABB block with the same width, but 1/4 of a pixel higher than the existing AABB block, below the existing AABB. Then, it checks if at least one block position (entire position) containing the new AABB has a block whose interaction box intersects the AABB. If no block intersects, the test fails.
If this stack has the {{DCL|lodestone_tracker}} component, updates the tracker (i.e. sets it to empty if it is invalidated).
 
'''useOn({{Tooltip|...|UseOnContext context}})'''
{{hatnote|Overrides method in [[#useOn(...)|{{jicp|}}]] }}
 
If the clicked block was a [[Minecraft:lodestone]], instead play the {{cd|item.lodestone_compass.lock}} sound event and create a lodestone compass by setting the {{DCL|lodestone_tracker}} component. If in creative mode or with a stack size greater than 1, all components are copied to a new item that gains {{DCL|lodestone_tracker}} and the original stack is shrunk by one. The interaction succeeds.
 
'''getName({{Tooltip|...|ItemStack itemStack}})'''
{{hatnote|Overrides method in [[#getName(...)|{{jicp|}}]] }}
 
If this stack has the {{DCL|lodestone_tracker}} component, instead return the lodestone compass item name (translation {{cd|item.minecraft.lodestone_compass}})
 
=== CrossbowItem ===
{{empty section}}
=== CushionItem ===
{{In development|je||26.3|section=1|note=Class add in [[Minecraft:26.3-snap3]].}}
{{Infobox hip|class=CushionItem|Items={{ItemLink|Cushion|id=Cushions}} (ColorCollection)}}
 
'''useOn({{tooltip|...|UseOnContext context}})'''
{{hatnote|Overrides method in [[#useOn(...)|{{jicp|}}]]}}
 
Position the cushion. Method partially described in {{slink|Cushion|Placement}}.
 
The interaction fails if the clicked face is not the up fece. Otherwise, summon an Axis-Aligned Bounding Box (AABB) with size of a cushion's hitbox (16×4×16 pixels), the X and Z axes centered on the interlocking block, and the minimum of the Y-axis at the clicked position.
 
If a cushion cannot survive in the AABB block ({{jcp|net.minecraft.world.entity.decoration.Cushion}}.{{cd|wouldSuriveAt(level, spawnAABB)}}), the interaction fails. The test consists of invoking a new AABB block with the same width, but {{frac|1|4}} of a pixel higher than the existing AABB block, below the existing AABB. Then, it checks if at least one block position (entire position) containing the new AABB has a block whose interaction box intersects the AABB. If no block intersects, the test fails.


At this point, the interaction returns success on the client side, and so the player moves their hand. Although the interaction may still fail on the server side, as described below:
At this point, the interaction returns success on the client side, and so the player moves their hand. Although the interaction may still fail on the server side, as described below:


* If the hitbox of an existing cushion is intersected by the AABB, the interaction fails.  
* If the hitbox of an existing cushion is intersected by the AABB, the interaction fails.  
* Try summoning a cushion. The interaction fails if for some reason it cannot be summoned.
* Try summoning a cushion, with {{cd|CustomName}} and {{cd|data}} defined repeatedly by the {{DCL|custom_name}} and {{DCL|custom_data}} components of the item stack. If, for some reason, it is not possible to invoke it, the interaction fails.
* Position the cushion in the same position as the AABB. The y-rotation of the cushion is defined by {{cd|[[Minecraft:w:Modulo|mod]](90 × [[Minecraft:w:Floor and ceiling functions|floor]]((''yRot'' + 0.5) ÷ 90), 360)}}, where {{cd|''yRot''}} is the player's y-rotation. The x-rotation is defined as zero.  
* Position the cushion in the same position as the AABB. The y-rotation of the cushion is defined by {{cd|[[Minecraft:w:Modulo|mod]](90 × [[Minecraft:w:Floor and ceiling functions|floor]]((''yRot'' + 0.5) ÷ 90), 360)}}, where {{cd|''yRot''}} is the player's y-rotation. The x-rotation is defined as zero.  
* Set the cushion color to match the item color (the item color is defined by ColorCollection when registering them).
* Set the cushion color to match the item color (the item color is defined by ColorCollection when registering them).
Line 1,360: Line 1,472:


=== DebugStickItem ===
=== DebugStickItem ===
{{empty section}}
{{Infobox hip|class=DebugStickItem|Debug Stick}}
 
Handles all the behavior of the [[Minecraft:debug stick]] as described on its page.
 
'''canDestroyBlock({{Tooltip|...|ItemStack itemStack, BlockState state, Level level, BlockPos pos, LivingEntity user}})'''
{{hatnote|Overrides method in [[#canDestroyBlock(...)|{{jicp|}}]] }}
 
Always returns {{cd|false}}, and triggers an interaction selecting a block state.
 
'''useOn({{Tooltip|...|UseOnContext context}})'''
{{hatnote|Overrides method in [[#useOn(...)|{{jicp|}}]] }}
 
Triggers an interaction cycling the value of a block state, failing if that interaction fails (if the player cannot use game master blocks, if the block has no properties, or if the item does not have the {{DCL|debug_stick_state}} component) and succeeding otherwise.
 
{{-}}
 
=== DiscFragmentItem ===
=== DiscFragmentItem ===


Line 1,427: Line 1,554:
{{empty section}}
{{empty section}}
=== GlowInkSacItem ===
=== GlowInkSacItem ===
{{empty section}}
{{info needed section|is this just used for signs, or are there other use cases?}}
 
=== HangingEntityItem ===
=== HangingEntityItem ===
{{empty section}}
{{empty section}}
Line 1,444: Line 1,572:
{{empty section}}
{{empty section}}
=== InkSacItem ===
=== InkSacItem ===
{{empty section}}
{{info needed section|is this just used for signs, or are there other use cases?}}
 
=== InstrumentItem ===
=== InstrumentItem ===
{{empty section}}
{{empty section}}
Line 1,520: Line 1,649:
However, currently, this doesn't affect the vanilla game at all, because besides the vanilla container recipes already being potions, it's not possible to customize them. Upcoming [[Minecraft:Java 26.3]], potion recipes began to be controlled by data packs; however, that instanceof has been discontinued.
However, currently, this doesn't affect the vanilla game at all, because besides the vanilla container recipes already being potions, it's not possible to customize them. Upcoming [[Minecraft:Java 26.3]], potion recipes began to be controlled by data packs; however, that instanceof has been discontinued.


=== ProjectileItem ===
{{empty section}}
=== ProjectileWeaponItem ===
=== ProjectileWeaponItem ===
{{empty section}}
{{empty section}}
Line 1,527: Line 1,654:
{{empty section}}
{{empty section}}
=== ShearsItem ===
=== ShearsItem ===
{{empty section}}
{{info needed section|shears do a handful of things to blocks you may expect the new block transformer component to do: setting kelp and vines to age 25, harvesting bee nests and beehives and setting their fullness to 0, and carving pumpkins to transform them from normal pumpkins to carved pumpkins. there's also the many entity interactions that exist nowadays}}
 
=== ShieldItem ===
=== ShieldItem ===


Line 1,549: Line 1,677:
{{-}}
{{-}}
=== SignItem ===
=== SignItem ===
{{empty section}}
{{In development|je||26.3|removed=1|section=1|note=Class removed in [[Minecraft:26.3-snap4]]. Non-hanging signs are now just {{jicp|StandingAndWallBlock}}. This property is now controlled by {{jbcp|Sing}}.}}
{{Infobox hip|class=SignItem
|Oak Sign|Spruce Sign|Birch Sign|Jungle Sign|Acacia Sign|Cherry Sign|Dark Oak Sign|Pale Oak Sign|Mangrove Sign|Bamboo Sign|Crimson Sign|Warped Sign
|Oak Hanging Sign|Spruce Hanging Sign|Birch Hanging Sign|Jungle Hanging Sign|Acacia Hanging Sign|Cherry Hanging Sign|Dark Oak Hanging Sign|Pale Oak Hanging Sign|Mangrove Hanging Sign|Bamboo Hanging Sign|Crimson Hanging Sign|Warped Hanging Sign|Items=
Upcoming ''[[Minecraft:Java 26.3]]'':<br>
{{Flatlist|
* {{BlockLink|Poplar Sign}}
* {{BlockLink|Poplar Hanging Sign}}
}}
|ext=
{{Flatlist|
*{{Slink||StandingAndWallBlockItem}}
*{{Slink||BlockItem}}}}
|impns= {{Slink||HangingSignItem}} }}
 
 
All instance of SignItem, being an instance of {{jicp|StandingAndWallBlockItem}}, have an {{cd|attachmentDirection}}, and a {{cd|wallBlock}}. The {{cd|attachmentDirection}} of non-hanging signs is defined as {{cd|down}}, and of hanging boards it is defined in {{jicp|HangingSignItem}} as {{cd|up}}.
 
'''updateCustomBlockEntityTag({{tooltip|...|BlockPos pos, Level level, @Nullable Player player, ItemStack itemStack, BlockState placedState}})'''
{{hatnote|Overrides method in [[#Place|{{jicp|Block}}]]}}
 
If there is no custom data on the sign (for example {{DCL|block_entity_data}}) or it cannot be applied (because the player does not have permission), then open the sign text editor ({{cd|sign.openTextEdit(player, signEntity, true)}}).
{{-}}
 
=== SmithingTemplateItem ===
=== SmithingTemplateItem ===
{{Infobox hip|class=SmithingTemplateItem|Netherite Upgrade|Sentry Armor Trim|Vex Armor Trim|Wild Armor Trim|Coast Armor Trim|Dune Armor Trim|Wayfinder Armor Trim|Raiser Armor Trim|Shaper Armor Trim|Host Armor Trim|Ward Armor Trim|Silence Armor Trim|Tide Armor Trim|Snout Armor Trim|Rib Armor Trim|Eye Armor Trim|Spire Armor Trim|Flow Armor Trim|Bolt Armor Trim}}
{{Infobox hip|class=SmithingTemplateItem|Netherite Upgrade|Sentry Armor Trim|Vex Armor Trim|Wild Armor Trim|Coast Armor Trim|Dune Armor Trim|Wayfinder Armor Trim|Raiser Armor Trim|Shaper Armor Trim|Host Armor Trim|Ward Armor Trim|Silence Armor Trim|Tide Armor Trim|Snout Armor Trim|Rib Armor Trim|Eye Armor Trim|Spire Armor Trim|Flow Armor Trim|Bolt Armor Trim}}
Line 1,762: Line 1,913:
{{empty section}}
{{empty section}}
=== SpyglassItem ===
=== SpyglassItem ===
{{empty section}}
{{info needed section|How does this apply its camera overlay? It's different from carved pumpkins: {{bug|MC-277451}}}}
 
=== StandingAndWallBlockItem ===
=== StandingAndWallBlockItem ===
{{empty section}}
{{info needed section|I assume this handles torches, but are signs, hanging signs, banners and heads also relevant? what about hoppers?}}
 
=== ThrowablePotionItem ===
=== ThrowablePotionItem ===
{{empty section}}
{{empty section}}
Line 1,812: Line 1,965:
* {{BlockLink|Dispenser|{{jcp|net.minecraft.core.dispenser.DispenseItemBehavior}}|link=#DispenseItemBehavior}}
* {{BlockLink|Dispenser|{{jcp|net.minecraft.core.dispenser.DispenseItemBehavior}}|link=#DispenseItemBehavior}}
* {{BlockLink|Anvil|{{jcp|net.minecraft.world.inventory.AnvilMenu}}|link=#AnvilMenu}}
* {{BlockLink|Anvil|{{jcp|net.minecraft.world.inventory.AnvilMenu}}|link=#AnvilMenu}}
* [[File:SlotSprite Bottle.png|20px|link=#PotionSlot]][[#PotionSlot|{{jcp|net.minecraft.world.inventory.BrewingStandMenu.PotionSlot}}]]  
* [[File:SlotSprite Bottle.png|20px|link=#PotionSlot]][[#PotionSlot|{{jcp|net.minecraft.world.inventory.BrewingStandMenu.PotionSlot}}]]{{Until|Java 26.3}}
* {{BlockLink|Cartography Table|{{jcp|net.minecraft.world.inventory.CartographyTableMenu}}|link=#CartographyTableMenu}}
* {{BlockLink|Cartography Table|{{jcp|net.minecraft.world.inventory.CartographyTableMenu}}|link=#CartographyTableMenu}}
* {{BlockLink|Enchanting Table|{{jcp|net.minecraft.world.inventory.EnchantmentMenu}}|link=#EnchantmentMenu}}
* {{BlockLink|Enchanting Table|{{jcp|net.minecraft.world.inventory.EnchantmentMenu}}|link=#EnchantmentMenu}}
Line 1,922: Line 2,075:
* {{ItemLink|crossbow-firework|{{jicp|Crossbow}}|link=#CrossbowItem}}
* {{ItemLink|crossbow-firework|{{jicp|Crossbow}}|link=#CrossbowItem}}
* {{ItemLink|enchanted-book|{{jicp|enchantment|EnchantmentHelper}}|link=#EnchantmentHelper}}
* {{ItemLink|enchanted-book|{{jicp|enchantment|EnchantmentHelper}}|link=#EnchantmentHelper}}
* {{BlockLink|Air| {{jicp|}} |link=#Item}}
* {{BlockLink|Air| {{jicp|}} |link=#Item (member access)}}
* {{InvLink|Monster Spawner|{{jicp|-Stack}}|link=#ItemStack}}
* {{InvLink|Monster Spawner|{{jicp|-Stack}}|link=#ItemStack}}
* {{BlockLink|Air|{{jicp|-StackTemplate}}|link=#ItemStackTemplate}}
* {{BlockLink|Air|{{jicp|-StackTemplate}}|link=#ItemStackTemplate}}
Line 2,039: Line 2,192:
{{-}}
{{-}}
=== PotionSlot ===
=== PotionSlot ===
{{In development|je||26.3|removed=1|section=1|note=Access to the item in [[Minecraft:26.3-snap3]] has been removed; it now uses the brewing inputs from the [[Minecraft:Recipe_(Java_Edition)#brewing|recipe]]s.}}


{{Infobox hip|class=PotionSlot|Potion|Splash Potion|Lingering Potion|Glass Bottle|pac=world.inventory|out={{cd|BrewingStandMenu}}}}
{{Infobox hip|class=PotionSlot|Potion|Splash Potion|Lingering Potion|Glass Bottle|pac=world.inventory|out={{cd|BrewingStandMenu}}}}
Line 2,047: Line 2,201:


It is also used in {{cd|quickMoveStack}}, so that these items are attempted to be moved from the inventory to the potion slot with a quick click ({{Keys|Shift}} + click). Notes:
It is also used in {{cd|quickMoveStack}}, so that these items are attempted to be moved from the inventory to the potion slot with a quick click ({{Keys|Shift}} + click). Notes:
* If the item is in the [[Minecraft:Item_tag_(Java_Edition)#brewing_fuel|#brewing_fuel]] tag, it will attempt to enter the fuel slot and not the potion slot (even if it fails to enter the fuel slot). The same occur with ingredients, however, ingredients are also [[#PotionBrewing|hardcoded]]{{Until|JE 26.3}} and don't have intersection.  
* If the item is in the {{Tag link|item|brewing_fuel}} tag, it will attempt to enter the fuel slot and not the potion slot (even if it fails to enter the fuel slot). The same occur with ingredients, however, ingredients are also [[#PotionBrewing|hardcoded]]{{Until|JE 26.3}} and don't have intersection.  
* This prevents quick clicking from moving them between [[Minecraft:Inventory#Slots|storage slots]] and hotbar slots and vice versa, when the brewing stand menu is open. Even if the itens fails to move to the potion slot.
* This prevents quick clicking from moving them between [[Minecraft:Inventory#Slots|storage slots]] and hotbar slots and vice versa, when the brewing stand menu is open. Even if the itens fails to move to the potion slot.


{{-}}
{{-}}
=== CartographyTableMenu ===
=== CartographyTableMenu ===


Line 2,538: Line 2,693:


=== DecoratedPotPatterns ===
=== DecoratedPotPatterns ===
{{In development|je||26.3|removed=1|section=1|note=Access to the item in [[Minecraft:26.3-snap1]] has been removed; it now uses the [[Minecraft:decorated pot pattern]] registry.}}
{{In development|je||26.3|removed=1|section=1|note=Access to the item in [[Minecraft:26.3-snap1]] has been removed; it now uses the [[Minecraft:Decorated pot pattern definition|decorated pot pattern]] registry.}}
{{Infobox hip|class=DecoratedPotPatterns|Brick|Angler Pottery Sherd|Archer Pottery Sherd|Arms Up Pottery Sherd|Blade Pottery Sherd|Brewer Pottery Sherd|Burn Pottery Sherd|Danger Pottery Sherd|Explorer Pottery Sherd|Flow Pottery Sherd|Friend Pottery Sherd|Guster Pottery Sherd|Heart Pottery Sherd|Heartbreak Pottery Sherd|Howl Pottery Sherd|Miner Pottery Sherd|Mourner Pottery Sherd|Plenty Pottery Sherd|Prize Pottery Sherd|Scrape Pottery Sherd|Sheaf Pottery Sherd|Shelter Pottery Sherd|Skull Pottery Sherd|Snort Pottery Sherd|pac=world.level.block.entity}}
{{Infobox hip|class=DecoratedPotPatterns|Brick|Angler Pottery Sherd|Archer Pottery Sherd|Arms Up Pottery Sherd|Blade Pottery Sherd|Brewer Pottery Sherd|Burn Pottery Sherd|Danger Pottery Sherd|Explorer Pottery Sherd|Flow Pottery Sherd|Friend Pottery Sherd|Guster Pottery Sherd|Heart Pottery Sherd|Heartbreak Pottery Sherd|Howl Pottery Sherd|Miner Pottery Sherd|Mourner Pottery Sherd|Plenty Pottery Sherd|Prize Pottery Sherd|Scrape Pottery Sherd|Sheaf Pottery Sherd|Shelter Pottery Sherd|Skull Pottery Sherd|Snort Pottery Sherd|pac=world.level.block.entity}}
'''{{Tooltip|ITEM_TO_POT_TEXTURE|Map&lt;Item, ResourceKey&lt;DecoratedPotPattern&gt;&gt;}}'''
'''{{Tooltip|ITEM_TO_POT_TEXTURE|Map&lt;Item, ResourceKey&lt;DecoratedPotPattern&gt;&gt;}}'''
Line 2,603: Line 2,758:


===FuelValues===
===FuelValues===
{{In development|je||26.3|removed=1|section=1|note=Access to the item in [[Minecraft:26.3-snap4]] has been removed; it now uses the {{DCL|cooking_fuel}} data component.}}
{{Infobox hip|class=FuelValues|Lava Bucket|Blaze Rod|Coal|Charcoal|Bow|Fishing Rod|Wooden Shovel|Wooden Sword||Wooden Spear|Wooden Hoe|Wooden Axe|Wooden Pickaxe|Stick|Bowl|Crossbow|pac=world.level.block.entity}}
{{Infobox hip|class=FuelValues|Lava Bucket|Blaze Rod|Coal|Charcoal|Bow|Fishing Rod|Wooden Shovel|Wooden Sword||Wooden Spear|Wooden Hoe|Wooden Axe|Wooden Pickaxe|Stick|Bowl|Crossbow|pac=world.level.block.entity}}


Line 2,613: Line 2,770:
Adding any item to tag {{Tag link|item|non_flammable_wood}} causes it to cease being a fuel item.
Adding any item to tag {{Tag link|item|non_flammable_wood}} causes it to cease being a fuel item.


Only lava bucket, [[Minecraft:block of coal]], blaze rod, coal, charcoal, [[Minecraft:dried kelp block]], [[Minecraft:bamboo]] and [[Minecraft:scaffolding]] have times that cannot be added to any other item via tags.
Only lava bucket, [[Minecraft:block of coal]], blaze rod, coal, charcoal, [[Minecraft:dried kelp block]], [[Minecraft:bamboo]]{{Until|Java 26.3-snap3}} and [[Minecraft:scaffolding]]{{Until|Java 26.3-snap3}} have times that cannot be added to any other item via tags.


Note that the higher up in the table, or when it doesn't belong to the table, the more customizable the item is, as its value can be substituted from a tag. Ironically, most hardcoded fuels have less customizable fuel time than other items. Tags with a green or orange background are the most suitable for adding items, as they can change a greater number of items. Items below these tags cannot have the fuel value given by them. Tags with an orange background are also used in other places, however, they are only used in the vanilla datapack, making it easy to substitute other uses.
Note that the higher up in the table, or when it doesn't belong to the table, the more customizable the item is, as its value can be substituted from a tag. Ironically, most hardcoded fuels have less customizable fuel time than other items. Tags with a green or orange background are the most suitable for adding items, as they can change a greater number of items. Items below these tags cannot have the fuel value given by them. Tags with an orange background are also used in other places, however, they are only used in the vanilla datapack, making it easy to substitute other uses.
Line 2,625: Line 2,782:
! colspan="2" | Time  
! colspan="2" | Time  
|-collapsed
|-collapsed
!{{Tooltip|Base Unit|200 ticks {{=}} fuel one item}} !! Ticks
!{{Tooltip|Base unit|200 ticks {{=}} fuel one item}} !! Ticks
|-
|-
|{{ItemLink|Lava Bucket}} || {{tc|in|100}} || {{tc|in|20000}}
|{{ItemLink|Lava Bucket}} || {{tc|in|100}} || {{tc|in|20000}}
Line 2,689: Line 2,846:
|{{BlockLink|Ladder}} || {{frac|3|2}} || 300
|{{BlockLink|Ladder}} || {{frac|3|2}} || 300
|-
|-
|{{tc|always|{{ItemSprite|signs}} {{tag link|item|signs}}}} || 1 || 200
|{{tc|always|{{ItemSprite|signs}} {{tag link|item|signs}}}}* || 1 || 200
|-
|-
|{{tc|always|{{ItemSprite|hanging signs}} {{tag link|item|hanging_signs}}}} || {{tc|Unknown|4}} || {{tc|Unknown|800}}
|{{tc|always|{{ItemSprite|hanging signs}} {{tag link|item|hanging_signs}}}} || {{tc|Unknown|4}} || {{tc|Unknown|800}}
Line 2,711: Line 2,868:
|{{BlockSprite|wool}} {{tag link|item|wool}} || {{frac|1|2}} || 100
|{{BlockSprite|wool}} {{tag link|item|wool}} || {{frac|1|2}} || 100
|-
|-
|{{BlockSprite|wooden buttons}} {{tag link|item|wooden_buttons}} || {{frac|1|2}} || 100
|{{BlockSprite|wool STAIRS}} {{tag link|item|wool_stairs}}{{Upcoming|Java 26.3-snap1}} || {{frac|1|2}} || 100
|-
|{{tc|always|{{BlockSprite|wool SLAB}} {{tag link|item|wool_slabs}}{{Upcoming|Java 26.3-snap1}}}} || {{frac|1|4}} || 50
|-
| {{BlockSprite|wooden buttons}} {{tag link|item|wooden_buttons}} || {{frac|1|2}} || 100
|-
|-
|{{ItemLink|Stick}} || {{frac|1|2}} || 100
|{{ItemLink|Stick}} || {{frac|1|2}} || 100
Line 2,719: Line 2,880:
|{{ItemLink|Bowl}} || {{frac|1|2}} || 100
|{{ItemLink|Bowl}} || {{frac|1|2}} || 100
|-
|-
|{{tc|Rarely|{{BlockSprite|carpets}} {{tag link|item|wool_carpets}}}} || {{tc|Unknown|{{frac|1|3}} + 0.005}} || {{tc|Unknown|67}}  
|{{tc|Rarely|{{BlockSprite|carpets}} {{tag link|item|wool_carpets}}}} || {{tc|Unknown|{{frac|1|3}} + {{frac|1|200}}}} || {{tc|Unknown|67}}  
|-
|-
|{{BlockLink|Dried Kelp Block}} || {{tc|in|20 + 0.005}} || {{tc|in|4001}}
|{{BlockLink|Dried Kelp Block}} || {{tc|in|20 + {{frac|1|200}} }} || {{tc|in|4001}}
|-
|-
|{{ItemLink|Crossbow}} ||{{frac|3|2}} || 300
|{{ItemLink|Crossbow}} ||{{frac|3|2}} || 300
|-
|-
|{{BlockLink|Bamboo}} || {{tc|yes|{{frac|1|4}}}} || {{tc|yes|50}}
|{{BlockLink|Bamboo}}* || {{tc|yes|{{frac|1|4}}}} || {{tc|yes|50}}
|-
|-
|{{BlockLink|Dead Bush}} || {{frac|1|2}} || 100
|{{BlockLink|Dead Bush}} || {{frac|1|2}} || 100
Line 2,733: Line 2,894:
|{{BlockLink|Tall Dry Grass}} || {{frac|1|2}} || 100
|{{BlockLink|Tall Dry Grass}} || {{frac|1|2}} || 100
|-
|-
|{{BlockLink|Scaffolding}} || {{tc|yes|{{frac|1|4}}}} || {{tc|yes|50}}
|{{BlockLink|Scaffolding}}* || {{tc|yes|{{frac|1|4}}}} || {{tc|yes|50}}
|-
|-
|{{BlockLink|Loom}} || {{frac|3|2}} || 300
|{{BlockLink|Loom}} || {{frac|3|2}} || 300
Line 2,754: Line 2,915:
|-
|-
|{{BlockLink|Leaf Litter}} || {{frac|1|2}} || 100
|{{BlockLink|Leaf Litter}} || {{frac|1|2}} || 100
|-
|{{tc|always|{{ItemSprite|CUSHIONS}} {{Tag link|Item|cushions}}}}{{tag|in: [[Minecraft:Java Edition 26.3 Snapshot 1|''JE 26.3-snap3'']]}} || 1 || 200
|}
|}
<nowiki>*</nowiki> Lines marked with asterisks no longer have a background color in [[Minecraft:Java Edition 26.3 Snapshot 1|''JE 26.3-snap1'']] or [[Minecraft:Java Edition 26.3 Snapshot 1|''JE 26.3-snap3'']].


The fuel list is used in:
The fuel list is used in:

Latest revision as of 11:08, 30 July 2026

Template:Italic title Template:Exclusive Template:Wip Template:Project Template:Cleanup

Hardcoded item properties are aspects of Minecraft:items which are tied to the IDs and cannot be customized fully via the use of Minecraft:commands or Minecraft:data packs.

Many of the properties associated with items in the game have been made controllable with the newly-introduced Minecraft:data component format; this intends to track things that are not currently controllable via components, item tags, recipes, advancements, enchantments and trades (though may be in future). Template:TOC

Item stacks properties

Most item instances in the game are through item stacks. An item stack is defined by its id, count and components.

Count

The count of an item is the easiest to control, and can largely be controlled even in Survival mode. Changing commands and components gives you more freedom to control it, although items with a count higher than their Template:DCL have some side effects and it is not possible, even with commands, to exceed a count of 99 or be less than 1.

However, the count is rarely used to affect the property of an item stack. Exceptions include the weight of the item in a bundle to test if it is full, the weight of the item in a container to be used by comparators, and using the item in trades. It is possible to control the quantity of items needed for a trade by commands and datapacks, the weight of the item in container is partially controlled by Template:Cd, and in bundles, in addition to being partially controlled by Template:Cd, it is also by Template:DCL and by Template:DCL. Furthermore, most uses of item stacks that do not depend on their count cannot be controlled to have to need it.

Components

Some components are partially controlled by changes made to the item in Survival mode. All components are strongly controlled by commands, although not entirely, as valid data is still required.

It is also possible to control the components of future item instances via datapacks, such as controlling the components of items in a Minecraft:loot table, the components of the result of many Minecraft:recipes (but not all, especially when the recipe result depends on the ingredient components), the components of the gives in villager Minecraft:trade, or the components of items that are in structures but are not part of a loot table (such as some chests in secret rooms of the Minecraft:woodland mansion).

However, there are origins of items that are not controlled by datapacks or commands, thus making it impossible to control the initial components of these items without Minecraft:mods (although it is possible to test when these items are originated and change their components later using datapacks).

Changes to an item's stack properties, depending on whether or not a certain component has it, can vary considerably. In some cases, the component affects all items that possess it and is highly customizable. In other cases, the component only affects stack items with certain IDs, or the component doesn't have much customizable data. Furthermore, some components affect more than one item property, making it impossible to activate only some of them.

Sometimes, properties that can be controlled by components have a lower priority than properties that depend on the item's ID, to the point that being used on certain items partially or completely loses its effect.

Default components

Default components are components that are defined for each item ID. If an item stack does not have a component defined in the component field, but has it as its default component, it will consider the value of its default component. If it has the component in the component field, it will consider the value of the component field.

With commands and datapacks, this control only extends to additional components, not default components. Default components depend solely on the item's ID and cannot be customized.

It is possible to remove a component of an item stack with Template:Cd. However, this will modify the item's data, adding a new component that serves to remove the previous one. This can impact, for example, comparisons of item data via commands, or picking up a block with a mouse click (since the block is only selected from your inventory if it doesn't have additional components).

Furthermore, some aspects of the items depend on their default component. For example, knowing which spawn egg will be picked up when clicking on an entity, or the villager controlling the number of items in the inventory to know whether to drop it.

Id

Often, an item's stack property depends on its ID. Sometimes it depends only on its ID, and other times it depends on both its ID and its components or count. The main objective of this article is to describe the item properties that depend on their ID; however, not all will be covered, as some item properties that depend on their ID are actually controlled by data packs and not hardcoded.

Note that all these properties, being controlled by ID and not by component, cannot be made so that only some item stacks possess them, because when adding an ID, all item stacks with the same ID will share it. Thus, customizing properties by component instead of ID is more powerful. Due to this and the impossibility of registering new IDs, it is possible that data pack projects will not be viable because they do not have enough items to define properties with different IDs.

Item tags

Many of an item's properties depend exclusively on it belonging to a certain item tag. Sometimes an item tag is used to describe a property that can also be changed at another time; for example, using a tag in a vanilla datapack file would allow you to directly use the item IDs there. However, there are item properties that can only be manipulated without mods by adding them to a tag. See item tag.

Recipes

Recipes can control the properties of items to be used in the manufacture of others. Although largely customizable, there are still some limitations, especially when considering the components of the ingredients for the final result. See Minecraft:recipes.

Enchantment definition

When defining an enchantment, it is necessary to define the items in Template:Cd and Template:Cd to specify which items can be crafted at the anvil and the enchanting table, respectively. See Minecraft:enchantment definition.

Mixed properties

Some properties may depend on the item's id, component, and count. Below is a list of these properties that can be controlled by data packs or commands.

Trade

Trade can be controlled either by commands (with Template:Cmd, editing villager data) or by Minecraft:villager trade definition. With them, you define the properties of an item stack, which can be trade for another by the villagers.

Item predicate

The item predicate is a subpredicate of Minecraft:predicates. Predicates can be used to test if a certain item satisfies a certain condition, and if so, contribute to the activation a certain Minecraft:loot table or Minecraft:advancement trigger. Loot tables are used to obtain items at various times. Advancement triggers, in addition to being used to receive advancements, are also used to unlock recipes.

Predicates are even more important for customizations, being used in commands or in advancement triggers to activate functions. Some commands like Template:Cmd are also very important in testing items and have an effect. Although we can use such commands to simulate a hardcoded item property or inhibit properties of certain items, this will hardly be done in a completely similar way, and the hardcoded properties will continue to exist, only being inhibited or copied.

Code structure

There are at least three ways in which the game code describes the properties of an item associated with its ID.

Item.Properties

In class Template:Jicp, the game defines a series of functions that can be applied to an item and change its properties. However, the vast majority of these properties ultimately only modify the item's default Minecraft:data components.

A complete list of default components in Template:V can be seen at Template:V-diff/items misode/mcmeta. The list for Template:V can be found here.

A notable exception is the Template:Cd property, which defines which item will remain in a recipe when using the item as a recipe. See below for a list of all craft reminders:

Item Craft remainder Vanilla use
Template:ItemLink Template:ItemLink Minecraft:Cake recipe.
Template:ItemLink Template:ItemLink Fuel remainder in Minecraft:smelting.
Template:ItemLink Template:ItemLink None.
Template:ItemLink Template:ItemLink Minecraft:Honey block and Minecraft:sugar recipes.
Template:ItemLink Template:ItemLink Ingredient remainder in Minecraft:brewing.Template:Note

All craft remainder can also be used in custom Minecraft:recipes via Minecraft:data packs. In code is also used in the craft display item, however it apparently hasn't been implemented in the gameTemplate:Info needed.

Adding some tags, such as Template:Tag link, to one of the items above, allow to use it as fuel and have the crafting remainder after. In the book and banner cloning recipe, the cloned item remains if it doesn't have a craft remainderTemplate:Note; if it does have a crafting remainder, the crafting remainder takes priority. Therefore, when placing one of the above items with a Template:Cd in the book cloning recipe, instead of keeping the item, it will keep its crafting remainder.

Another exception is the item Template:Cd, which can be Template:Cd or Template:Cd. Although its primary use is for the item name, the Template:DCL default component, this description id is also used for other things, such as potion names and disc fragment descreipition.

The last exception is the Template:Cd propertie, although it's not important in the current version. It serves to list which Minecraft:experiments must be active to use a certain item in many cases. Currently, no item is exclusive to any experiment; thus, all have this property with its default value Template:Cd.

Most of the Template:Cd applied to items are applied from the item's registered in Template:Jicp.

Item subclasses (code structure)

In the Template:Jcp package, there are many classes that define properties for a certain item or a certain set of items; these classes extend the Template:Jicp class. A large part of the hardcoded item properties come from here.

These classes have Template:Cd as their name, such as Template:Cd, Template:Cd, and Template:Cd.

In many cases, when an item is registered in Template:Jicp, it is already created as a new instance of one of these classes.

Some of them are abstract classes, not having any item that is restricted as a new instance of that class; however, these classes are extended by other classes, and so on until reaching a class that is at least one item, which is then restricted as a new instance of the class.

Most of the properties of an item defined as belonging to a specific subclass are defined within the subclass itself. However, sometimes in other classes, Template:Cd is used to test if a certain item is an item of that class, and thus new properties can be defined for the item.

List

The table below shows the classes that extend Template:Jicp and the IDs of the items that are restricted as instances of them (in Template:Jicp).

See Template:Slink for details.

Items class member access

In many parts of the game's code, within many contexts, direct access to an item's restricted area is used, by Template:Jicp member access, allowing to determine a property of that item.

In certain cases, this item call only serves to create the vanilla datapack, for example by creating item tags, recipes, Minecraft:loot tables and trades. Therefore, this is a property that can be fully controlled by Minecraft:datapacks. However, it's worth noting that many of these properties that we can fully control through data packs (and not through components) can only be controlled by the item's ID, not by its components.

Furthermore, in some cases, it creates a new instance of the item. This could be due to an item origin not controlled by a loot table (such as equipment or wither flowers), a visual effect (such as using items in a GUI), or some other use (such as a mob using an item as a projectile). In these cases, we are not strictly talking about an item property, as we are not discussing how a pre-existing item modifies the game.Template:Note

List

The table below shows all the classes that has a Template:Jicp memmber access, and the number of uses in each class. According to the code of Minecraft:26.1.

Legend:

  • red The background indicates that all items within that class are used only for generating the vanilla datapack/resourepack.
  • yellowThe background indicates that all items within them are a new instance, representing an item's origin, visual use, etc., and not a property of a pre-existing item.

See Template:Slink, for details of the classes without note

Item class

Template:Expand section

onUseTick(...)

onUseTick
Declaration Header

public void

Parameters

Level level, LivingEntity livingEntity, ItemStack itemStack, int ticksRemaining

Empty, for most items, it doesn't add any properties. However, it can add properties with its implementations, see below.

Uses tree

Template:Blist

Implementations

onDestroyed(...)

onDestroyed
Declaration Header

public void

Parameters

ItemEntity itemEntity

Used for items to drop their contents to be destroyed. By default, nothing happens, having an effect only on instances of classes that implement it, see below.

Uses tree

Template:Blist

Implementations

canDestroyBlock(...)

canDestroyBlock
Declaration Header

public boolean

Parameters

ItemStack itemStack, BlockState state, Level level, BlockPos pos, LivingEntity user

Returns false if the player is in Template:Tooltip and the item has the Template:DCL component with Template:Cd set to false. In other cases it returns true.

Note that this method depends exclusively on the component and is not hardcoded. However, the method still has an implementation.

Uses tree

Template:Blist

Implementations

useOn(...)

useOn
Declaration Header

public InteractionResult

Parameters

UseOnContext context

Until Minecraft:Java Edition 26.3, it only returns the interaction result Template:Cd. However, in implementations, in addition to the side effects (the core of the method), it can return interaction results such as Template:Cd and Template:Cd. These returns can have some subsequent effect as shown in the tree below.

Upcoming Minecraft:Java Edition 26.3, if the Template:DCL data default of the item in hand is not empty, it attempts to transform the interacted block, with the return value depending on the transformation; otherwise, it returns FAIL. However, default Template:Cd data components exist only for Minecraft:hoes, Minecraft:shovels, and Minecraft:axes; many items still rely on hardcoded usage logic (see the implementations below).

Uses tree

Template:Blist

Description of the methods:

Otherwise, call the method implemented in the item stack as item. If the method returns Template:Cd increases the item Template:Cd Minecraft:statistic by one. Returns the return value of the called method.
If the player is in the Minecraft:spectator mode: if the block has a menu, open the menu and return Template:Cd, otherwise return Template:Cd.
If the player is not Minecraft:sneaking or doesn't have items in either hand:
  • The player will attempt to use the item, or the empty hand, on the block. However, for this use, the previous method will not be used, but rather Template:Cd, which is a method controlled by the block (Template:Cd). Sometimes this method will give different results depending on the item used; see Template:Sl for details.
  • If the interaction returns any success, [[Minecraft:Advancement_definition#minecraft:item_used_on_block|Template:Cd]] is activated and the method is completed, returning the same result.
  • If the interaction returns Template:Cd and the interacting hand is the mainhand, the player attempts to interact with the block using the Template:Cd method.
    • If the interaction returns any success, [[Minecraft:Advancement_definition#minecraft:default_block_use|Template:Cd]] is activated the method is completed, returning the same result.
  • If neither Template:Cd nor Template:Cd returns success, the method continues.
If the item stack is empty or in cooldown, return Template:Cd.
Finally, the Template:Cd method is called. If the player is in creative mode, the stack item quantity is restored, preventing any loss due to the called method. If the return is successful, the Template:Cd is activated. Returns the return of the called method.
In Template:Jcp, output demo reminder and return Template:Cd, if demo timer has end. Otherwise, it calls the supermethod, so the method will proceed normally.
  • Template:Jcp.Template:Cd: Initially, it tests if the interaction is allowed, if positive, call the method. If the return of the called method is successful, the [[Minecraft:Advancement_definition#minecraft:any_block_use|Template:Cd]] is activated.
If the interaction is unsuccessful, the interaction direction is up, the interacted block is at its maximum height, and the item is a Template:Slink or Template:Slink instance with non-empty fluid and is not on cooldown, then send the system error message in Minecraft:action bar with the translation of Template:Cd with the maximum height value of the dimension.
If the return of the called method is Template:Cd or Template:Cd, the player swings the hand used.

Implementations Template:Columns-list Template:Font color The implementation uses a supermethod, calling that method.

use(...)

finishUsingItem(...)

isBarVisible(...)

getBarWidth(...)

getBarColor(...)

overrideStackedOnOther(...)

overrideOtherStackedOnMe(...)

getAttackDamageBonus(...)

getItemDamageSource(...)

hurtEnemy(...)

postHurtEnemy(...)

mineBlock(...)

interactLivingEntity(...)

inventoryTick(...)

onCraftedPostProcess(...)

getUseAnimation(...)

getUseDuration(...)

releaseUsing(...)

appendHoverText(...)

getTooltipImage(...)

getName(...)

isFoil(...)

useOnRelease(...)

getDefaultInstance()

canFitInsideContainerItems()

shouldPrintOpWarning(...)

Item subclasses

Template:Expand section Only subsections marked with an asterisk (Template:Past) aren't empty.

Template:Columns-list

AirItem

Template:Infobox hip

Air has a block Template:Cd, meaning its translation key is Template:Cd. However, unlike other items with this Template:Cd, air is not an instance of Template:Jicp, because Template:Jicp does not extend Template:Jicp.

getName(Template:Tooltip) Template:Hatnote

Defined ignoring the item stack components, therefore, it is always a translation of Template:Cd regardless of the component Template:DCL.

This has an effect on stacked items that are treated as if they were air (for example, items with a count of 0).

Note that many other properties of the air item are defined elsewhere in the code. See Template:Slink.

ArmorStandItem

Template:Infobox hip

useOn(Template:Tooltip) Template:Hatnote

If the interaction involves clicking on the bottom face of a block, it fails.

The target position for placing the Minecraft:armor stand is the bottom center of the block next to the interacted block, in the direction of the interacted face. The game simulates the Minecraft:hitbox of an armor stand in this position; if the hitbox collides with a block or intersects with an entity hitbox (except Minecraft:spectators), the interaction fails.

The game attempts to obtain the armor stand, based on the item's components Template:DCL, Template:DCL, and Template:DCL. If it cannot be generated, the interaction fails.

If the armor stand is generated, apply in the following order:

The interaction returns success given no aforementioned fails occur.

Armor stand entity data:

ArrowItem

Template:Infobox hip

createArrow(Template:Tooltip)

Creates an Template:Cd projectile entity from the item.

Used by Template:Cd in Template:Slink, and by Minecraft:skeletons and Minecraft:illusioners via Template:Slink.

For regular arrows, creates an arrow projectile with:

asProjectile(Template:Tooltip) Template:Hatnote

Creates an arrow projectile not fired from any weapon, used by Minecraft:dispensers and Minecraft:ominous item spawners, with:


AxeItem

Template:In development

Template:Infobox hip

useOn(Template:Tooltip) Template:Hatnote


BannerItem

Template:Infobox hip

getColor()

Used by the [[Minecraft:Recipe_(Java_Edition)#crafting_special_*|Template:Cd]] recipe type to determine whether the banner colors match, and by the [[Minecraft:Recipe_(Java_Edition)#crafting_special_*|Template:Cd]] recipe type to set the Template:DCL of the shield.

This is done by calling the Template:Cd method of Template:Cd on the item's block form, and as such the block forms of a Template:Cd must extend Template:Cd.


BedItem

Template:In development

Template:Infobox hip

placeBlock(Template:Tooltip) Template:Hatnote

Set the block with update flags of 26 instead of 11.

BlockItem

Template:Expand section Template:Infobox hip

Each item in this class is associated with a block, defined in Template:Jicp. With few exceptions, the item has the same id as the associated block and Template:Cd is the item's Template:Cd.

Item overrides methods

useOn(Template:Tooltip) Template:Hatnote

Try placing the block with Template:Cd (see Template:Slink for details).

If the result of place is any success and the item does not have the component Template:DCL, return that result from place. Otherwise, use the item (see Template:Slink) and return the result of use.

shouldPrintOpWarning(Template:Tooltip) Template:Hatnote

If the player has Minecraft:Permission level gamemaster (level 2) and the item has the component Template:DCL, it returns true if the block entity id is Template:Cd, Template:Cd, Template:Cd, Template:Cd, Template:Cd, or Template:Cd. Otherwise, it returns false.

canFitInsideContainerItems() Template:Hatnote

Returns false if the associated block is an instance of Template:Jbcp, in other words, one of the 17 Minecraft:shulker boxes.

onDestroyed(Template:Tooltip) Template:Hatnote

Set the Template:DCL component of the entity item to empty. If the component existed previously, drop all the item stacks it contained at the entity item's position.

Place

Block by item

Template:Expand section

There are two methods in Template:Jicp related to associating the item with its associated block and vice-versa:

In Template:Jicp, ItemBlocks are registered using either the Template:Cd method or the Template:Cd method.

In Template:Cd given a block, an item is created with the same id, and with the block description id, after that Template:Cd is used to save the block and item in Template:Cd. There are some variations, which can be summarized as: adding default components to the item (by Template:Slink), making the item a different class, a subclass of ItemBlock and put alternative blocks in Template:Jicp.Template:Cd.

Only two items have alternate blocks:

However, in Template:Slink, there is an override of Template:Cd, adding the wallblock corresponding to each item in the list.

In Template:Cd the item's ID is defined separately and uses the item's description ID. Items can have other default components, but it is always a BlockItem and not a subclass. Below is the complete list of items registered with this method:

Resin clump and nether wart has the same ID but it still has different ID descriptions.

The method Template:Cd is only used in Template:Jicp, however Template:Cd has many more uses.

[...]

The Template:Jicp.Template:Cd map is used in the Template:Jicp.Template:Cd method, where for each block it searches for its associated item, and if it doesn't exist, it associates it with the air item. This method is used only in Template:Jbcp.Template:Cd which returns the item associated with the block. The Template:Jbcp.Template:Cd method, however, has multiple uses.

[...]

Usage in instanceof

BoatItem

Template:Infobox hip

use(Template:Tooltip) Template:Hatnote

Checks if the player is looking at a block (including fluids) and passes if not. Then checks if any pickable entities' pick hitboxes contain the player's eye position and passes if so.

Then tries to create a boat entity with a type hardcoded for each item ID at the block targeted and fails if the entity cannot be created. If it is spawned, its yaw rotation is set to the player's yaw rotation. Then fails if the boat is intersecting anything except fluid.

Finally, adds the boat to the world, produces an Template:Cd Minecraft:game event, consumes one item from the stack, adds to the item used statistic, and succeeds.


BoneMealItem

Template:Infobox hip

All the behavior of bone meal is hardcoded in this class.

useOn(Template:Tooltip) Template:Hatnote

First calls Template:Cd. If it returns Template:Cd, the interaction succeeds, the stack shrinks by one, world event 1505 (bone meal particles and sound) is caused, and an Template:Cd Minecraft:game event is produced.

Otherwise, checks if a full solid face was clicked (passing if not) and calls Template:Cd, succeeding as described above if it returns Template:Cd. If it returns Template:Cd, the interaction passes.

growCrop(Template:Tooltip)

Tries to bone meal a Template:Cd. If it is valid, regardless of whether it succeeds, returns Template:Cd (otherwise returns Template:Cd).

Also used by Minecraft:dispensers and Template:Slink.

growWaterPlant(Template:Tooltip)

Attempts to grow plants underwater, defaulting to Minecraft:seagrass. Returns Template:Cd if the block next to the clicked face is not a full water block, and Template:Cd otherwise.

If used in a biome in Template:Tag link, the block next to the clicked face is replaced with a random block in Template:Tag link if a side face was clicked, and other seagrass blocks that would be placed have a 1/4 chance of being replaced with random blocks from Template:Tag link.

Also used by Minecraft:dispensers.


BottleItem

Template:Infobox hip

use(Template:Tooltip) Template:Hatnote

First checks for Minecraft:area effect clouds owned by an Minecraft:ender dragon (i.e. dragon's breath) within 2 blocks of the player's hitbox. If there is at least one, picks one and reduces its radius by 0.5, plays the Template:Cd sound event, produces a Template:Cd game event, triggers the Template:Cd advancement trigger, transforms a bottle (or all of them, if the player is in Creative mode) into Minecraft:dragon's breath, and succeeds.

If there is not any dragon's breath, checks if the player is interacting with water (passing otherwise) and plays the Template:Cd sound event, produces a Template:Cd game event, transforms a bottle (or all of them) into a Minecraft:water bottle, and succeeds.


BowItem

Template:Empty section

BrushItem

Template:Empty section

BucketItem

Template:Empty section

BundleItem

Template:Empty section

CompassItem

Template:Infobox hip

isFoil(Template:Tooltip) Template:Hatnote

Overridden to Template:Cd if this stack has the Template:DCL component.

inventoryTick(Template:Tooltip) Template:Hatnote

If this stack has the Template:DCL component, updates the tracker (i.e. sets it to empty if it is invalidated).

useOn(Template:Tooltip) Template:Hatnote

If the clicked block was a Minecraft:lodestone, instead play the Template:Cd sound event and create a lodestone compass by setting the Template:DCL component. If in creative mode or with a stack size greater than 1, all components are copied to a new item that gains Template:DCL and the original stack is shrunk by one. The interaction succeeds.

getName(Template:Tooltip) Template:Hatnote

If this stack has the Template:DCL component, instead return the lodestone compass item name (translation Template:Cd)

CrossbowItem

Template:Empty section

CushionItem

Template:In development Template:Infobox hip

useOn(Template:Tooltip) Template:Hatnote

Position the cushion. Method partially described in Template:Slink.

The interaction fails if the clicked face is not the up fece. Otherwise, summon an Axis-Aligned Bounding Box (AABB) with size of a cushion's hitbox (16×4×16 pixels), the X and Z axes centered on the interlocking block, and the minimum of the Y-axis at the clicked position.

If a cushion cannot survive in the AABB block (Template:Jcp.Template:Cd), the interaction fails. The test consists of invoking a new AABB block with the same width, but Template:Frac of a pixel higher than the existing AABB block, below the existing AABB. Then, it checks if at least one block position (entire position) containing the new AABB has a block whose interaction box intersects the AABB. If no block intersects, the test fails.

At this point, the interaction returns success on the client side, and so the player moves their hand. Although the interaction may still fail on the server side, as described below:

  • If the hitbox of an existing cushion is intersected by the AABB, the interaction fails.
  • Try summoning a cushion, with Template:Cd and Template:Cd defined repeatedly by the Template:DCL and Template:DCL components of the item stack. If, for some reason, it is not possible to invoke it, the interaction fails.
  • Position the cushion in the same position as the AABB. The y-rotation of the cushion is defined by Template:Cd, where Template:Cd is the player's y-rotation. The x-rotation is defined as zero.
  • Set the cushion color to match the item color (the item color is defined by ColorCollection when registering them).
  • Play Minecraft:sound event cushion place (Template:Sound)
  • Produce the Minecraft:game event Template:Cd (output 14)
  • Consumes one item from the player, except if the player is in Template:Tooltip.

The interaction returns success given no aforementioned fails occur.

DebugStickItem

Template:Infobox hip

Handles all the behavior of the Minecraft:debug stick as described on its page.

canDestroyBlock(Template:Tooltip) Template:Hatnote

Always returns Template:Cd, and triggers an interaction selecting a block state.

useOn(Template:Tooltip) Template:Hatnote

Triggers an interaction cycling the value of a block state, failing if that interaction fails (if the player cannot use game master blocks, if the block has no properties, or if the item does not have the Template:DCL component) and succeeding otherwise.


DiscFragmentItem

Template:Infobox hip

appendHoverText(Template:Tooltip) Template:Hatnote

Define the first line of the tooltip as the translation of Template:Cd in gray (Template:Color).

This line cannot be hidden by the Template:DCL component, except to completely hide the tooltip with Template:Cd set to Template:Cd.

DispensibleContainerItem

Template:Empty section

DoubleHighBlockItem

Template:Empty section

DyeItem

Template:Infobox hip

Each item has a default Template:DCL component, defined in Template:Jicp.

When two sheep, cats, or dogs breed, take the color of each parent (the color of the wool or the color of the collar) and search all items that have the component Template:Cd of that color as a default and try to create the first recipe for each pair. If the result of some of these recipes is an item with the component Template:Cd, that color will be used for the offspring; otherwise, a random color from the parents is added.

Thus, the color of these animals depends on the hardcoded property of the dyes, and the color can only be edited along with the item's recipes. Only dyes have the component Template:Cd by default, and each value of the component exists in exactly one dye.

interactLivingEntity(Template:Tooltip) Template:Hatnote

The interaction is only successful, instead of pass, when the interacting entity is a non-sheared live Minecraft:sheep of a different color than the Template:Cd component and the item stack has a Template:Cd component.

In case of success, the Minecraft:sound dye use is played, set the sheep color and shrink the item stack by one.

tryApplyToSign(Template:Tooltip) Template:Hatnote

If the stack item does not contain the Template:Cd component, it returns false.

Try changing the text color on the sign, on the side being interacted with, to the color of the dye.

In case of success, the dye used sound is played and returns true. Otherwise, returns false.

EggItem

Template:Empty section

EmptyMapItem

Template:Empty section

EndCrystalItem

Template:Empty section

EnderEyeItem

Template:Empty section

EnderpearlItem

Template:Empty section

ExperienceBottleItem

Template:Empty section

FireChargeItem

Template:Empty section

FireworkRocketItem

Template:Empty section

FishingRodItem

Template:Empty section

FlintAndSteelItem

Template:Empty section

FoodOnAStickItem

Template:Empty section

GameMasterBlockItem

Template:Empty section

GlowInkSacItem

Template:Info needed section

HangingEntityItem

Template:Empty section

HangingSignItem

Template:Empty section

HoeItem

Template:In development

Template:Infobox hip

useOn(Template:Tooltip) Template:Hatnote


HoneycombItem

Template:Empty section

InkSacItem

Template:Info needed section

InstrumentItem

Template:Empty section

ItemFrameItem

Template:Empty section

KnowledgeBookItem

Template:Empty section

LeadItem

Template:Empty section

LingeringPotionItem

Template:Empty section

MaceItem

Template:Empty section

MapItem

Template:Empty section

MinecartItem

Template:Empty section

MobBucketItem

Template:Empty section

NameTagItem

Template:Infobox hip

interactLivingEntity(Template:Tooltip) Template:Hatnote

The interaction will only be successful, instead of pass, when:

If the entity is alive, sets its Template:Cd to be the same as the name tag. If the entity is a mob, also sets Template:Cd true. Shrink the item stack of the item by one.

Note: This method is only called for living entities, so it ends up being a redundant under certain conditions. Even though the ender dragon is a living entity, this method is never called by it because when trying to interact with it, the Template:Cd is actually being interacted, which is not a living entity.

PlaceOnWaterBlockItem

Template:Empty section

PlayerHeadItem

Template:Empty section

PotionItem

Template:Infobox hip

useOn(Template:Tooltip) Template:Hatnote

The interaction will only be successful, instead of pass, when:

  • the face of the interacted block was not directed downward,
  • the block is in the #convertable_to_mud tag, and
  • the potion's content is water.

In case of success, apply in the following order:

  1. Play the generic splash Minecraft:sound event (Template:Cd),
  2. Set Minecraft:glass bottle in hand,
  3. Send splash particles,
  4. Play the bottle empty sound event (Template:Cd),
  5. Produce the Minecraft:game event Template:Cd,
  6. Convert the block to Minecraft:mud.

getName(Template:Tooltip) Template:Hatnote

If the item has the component Template:Cd, the name name is defined from it. The item uses the translation key Template:Cd, where Template:Cd is the custom name of the potion contents, if available, and otherwise is the name of the potion in potion contents (see Template:Slink), if available. If nether is available, is "Template:Cd".

This name will replace the name defined by Template:DCL. However, it can still be replaced by the Template:DCL, if available.

Usage in instanceof

The class Template:Jicp has one instanceof usageTemplate:Until. This usage occurs in Template:Jicp.Template:Cd to validate the method that adds container recipes.

In vanilla, this method adds the Minecraft:brewing recipes that transform potions into splash potions and splash potions into lingering potions. If the source item or the destination item is not an instance of Template:Jicp, it throws an Template:Cd, immediately aborting the method and logging the error Template:Cd.

However, currently, this doesn't affect the vanilla game at all, because besides the vanilla container recipes already being potions, it's not possible to customize them. Upcoming Minecraft:Java 26.3, potion recipes began to be controlled by data packs; however, that instanceof has been discontinued.

ProjectileWeaponItem

Template:Empty section

ScaffoldingBlockItem

Template:Empty section

ShearsItem

Template:Info needed section

ShieldItem

Template:Infobox hip

getName(Template:Tooltip) Template:Hatnote

If the item has the component Template:DCL, the name is defined from it. The item uses the translation key Template:Cd.

This name will replace the name defined by Template:DCL component. However, it can still be replaced by the Template:DCL component, if available.

ShovelItem

Template:In development

Template:Infobox hip

useOn(Template:Tooltip) Template:Hatnote


SignItem

Template:In development Template:Infobox hip


All instance of SignItem, being an instance of Template:Jicp, have an Template:Cd, and a Template:Cd. The Template:Cd of non-hanging signs is defined as Template:Cd, and of hanging boards it is defined in Template:Jicp as Template:Cd.

updateCustomBlockEntityTag(Template:Tooltip) Template:Hatnote

If there is no custom data on the sign (for example Template:DCL) or it cannot be applied (because the player does not have permission), then open the sign text editor (Template:Cd).

SmithingTemplateItem

Template:Infobox hip

New SmithingTemplateItem

Each instance of SmithingTemplateItem has a series of class-specific attributes, which are defined by Template:Cd. However, these attributes are not defined separately for each item; instead, they are defined by the Template:Cd and Template:Cd methods, where respectively defines the attributes of netherite upgrade and of all armor trims. In Template:Jicp, only the item components are defined (by Template:Slink, which in this case is only the Template:DCL component).

These methods use the Template:Cd, Template:Cd, Template:Cd, and Template:Cd auxiliary methods, and many auxiliary constants to create these attributes. Below is the complete table of these attributes:

Attribute Items Value
appliesTo Armor Trim Minecraft:Text component format Template:Cd
Text in Template:Mono "Armor" (Template:Color)
Netherite Upgrade Text component format Template:Cd
Text in Template:Mono "Diamond Equipment" (Template:Color)
ingredients Armor Trim Text component format Template:Cd
Text in Template:Mono "Ingots & Crystals" (Template:Color)
Netherite Upgrade Text component format Template:Cd
Text in Template:Mono "Netherite Ingot" (Template:Color)
baseSlotDescription Armor Trim Text component format Template:Cd
Text in Template:Mono "Add a piece of armor" (Template:Color)
Netherite Upgrade Text component format Template:Cd
Text in Template:Mono "Add diamond armor, weapon, or tool" (Template:Color)
additionsSlotDescription Armor Trim Text component format Template:Cd
Text in Template:Mono "Add ingot or crystal" (Template:Color)
Netherite Upgrade Text component format Template:Cd
Text in Template:Mono "Add Netherite Ingot" (Template:Color)
baseSlotEmptyIcons Armor Trim Asset ID

Template:Flatlist

Textures

Template:Flatlist

Netherite Upgrade Asset ID Template:Flatlist
Textures Template:Flatlist
additionalSlotEmptyIcons Armor Trim Asset ID Template:Flatlist
Textures Template:Flatlist
Netherite Upgrade Asset ID Template:Flatlist
Textures Template:Flatlist

Asset ID refers to textures file path in Template:Mono.

Append hover text

public void appendHoverText(Template:Tooltip) Template:Hatnote

Add the following lines to the beginning of the item's tooltip, in order:

Smithing table screen

There are 4 methods that always give the assigned values ​​of the sprint items, namely Template:Cd, Template:Cd, Template:Cd, and Template:Cd. All of them are used only in the Template:Jcp class. This class defines the behavior of the menu slots in the Minecraft:smithing table, controlling both the sprint that appears in empty slots and the tooltip when hovering the mouse over an empty slot. Furthermore, this class uses two instanceof of SmithingTemplateItem (and in no other class of the code is it used instanceof of SmithingTemplateItem).

Slot background

Slots 0, 1, and 2 of the menu use a rendering of their variable background given by a list of identifiers (asset IDs), defined by the class Template:Jcp. With each tick update:

  • If the icons list is different from the old icons list, update the icons list and reset the index of the list to zero.
  • If the current list is not empty:
    • Increase the tick count by one.
    • If the tick count is a multiple of 30, increase the index of the identifier by one; return to zero if it exceeds the limit of the list.

And when render the slot background:

  • If the list is empty or the slot is not empty: do nothing.
  • If the tick count is greater than 30 and fewer than t + a < 4.0, where t is how many ticks have passed the last multiple of 30: render the previous icon (one index lower or the last one in the list if the index is zero) with Template:Cd transparency.Template:More info
  • Renderize the current index with Template:Cd of transparency.

Note that in this way each icon occupies the slot for 30 ticks and has a smooth transition of 4 ticks.

In Template:Jcp, each tick updates the tick of Template:Jcp, from slots 0, 1, and 2, with a list that may vary:

Template:Flatlist
  • For slot 1, if there is no instance of SmithingTemplateItem in slot 0, the list is empty. If there is, it is the Template:Cd of the item.
  • For slot 2, if there is no instance of SmithingTemplateItem in slot 0, the list is empty. If there is, it is the Template:Cd of the item.

Boarding Tooltips

Depending on the mouse position, among other factors, the switcher table menu renders a tooltip.

  • Mouse over a rectangular area around the arrow: if the recipe has an error (has items in slots 0, 1, and 3 but no result): "Item can't be upgraded this way" (Template:Color)
  • If the mouse is in slot 0 and it is empty: "Add Smithing Template" (Template:Color)
  • If the mouse is in slot 1, it is not empty, and slot 0 has an instance of SmithingTemplateItem: the Template:Cd from item in slot 0.
  • If the mouse is in slot 2, it is not empty, and slot 0 has an instance of SmithingTemplateItem: the Template:Cd from item in slot 0.
  • In any other case: it does not render a menu tooltip (although it continues to render item tooltips normally).

SnowballItem

Template:Empty section

SolidBucketItem

Template:Empty section

SpawnEggItem

Template:Empty section

SpectralArrowItem

Template:Empty section

SplashPotionItem

Template:Empty section

SpyglassItem

Template:Info needed section

StandingAndWallBlockItem

Template:Info needed section

ThrowablePotionItem

Template:Empty section

TippedArrowItem

Template:Empty section

TridentItem

Template:Empty section

WindChargeItem

Template:Empty section

WritableBookItem

Template:Infobox hip

use(Template:Tooltip) Template:Hatnote

Open item GUI and increases the Template:Cd Minecraft:statistic by one. Always returns successful.

Note:

The item GUI depends on the components Template:DCL and Template:DCL. Therefore:

  • If the item does not have either component: nothing is opened, but there is still an increase in statistics and usage animation.
  • If the item has only one of these components: the corresponding GUI opens.
  • If both components are present: both GUIs open, but the written book content GUI completely overlays the writable book content GUI, which the player can see briefly on the screen.

Therefore, the GUI are entirely dependent on the components and independent of the item ID. However, it is only possible to open them with the Minecraft:book and quill and Minecraft:written book, since only these items attempt to open the GUI.

WrittenBookItem

Template:Infobox hip

use(Template:Tooltip) Template:Hatnote

Completely identical to Template:Cd; see the Template:Slink.



Items member access

Blocks

Template:Columns-list

Entity

Template:Columns-list


Misc

Template:Columns-list

CauldronInteractions

Template:Empty section

DispenseItemBehavior

Template:Expand section Template:Infobox hip

bootStrap()

Defines the item's behavior when Minecraft:dispenser. The behaviors Template:Cd and Template:Cd are largely defined uniquely for each item.

Item Behavior
Template:InvLink ProjectileBehavior
Template:InvLink
Template:InvLink
Template:ItemLink
Template:InvLink
Template:InvLink
Template:InvLink
Template:InvLink
Template:InvLink
Template:InvLink
Template:InvLink
Template:InvLink DefaultDispenseItemBehavior
Template:InvLink OptionalDispenseItemBehavior
Template:ItemLink BoatDispenseItemBehavior
Template:ItemLink
Template:InvLink filledBucketBehavior
Template:InvLink
Template:InvLink
Template:ItemLink
Template:InvLink DefaultDispenseItemBehavior
Template:InvLink OptionalDispenseItemBehavior
Template:InvLink OptionalDispenseItemBehavior
Template:InvLink OptionalDispenseItemBehavior
Template:BlockLink shulkerBoxDispenseBehavior
Template:InvLink OptionalDispenseItemBehavior
Template:InvLink OptionalDispenseItemBehavior
Template:InvLink ShearsDispenseItemBehavior
Template:InvLink OptionalDispenseItemBehavior
Template:InvLink OptionalDispenseItemBehavior
Template:InvLink DefaultDispenseItemBehavior
Template:InvLink MinecartDispenseItemBehavior
Template:InvLink
Template:InvLink
Template:InvLink
Template:InvLink
Template:InvLink


AnvilMenu

Template:Infobox hip

createResult()

If the Minecraft:anvil input is an enchanted book, it will initially consider any Minecraft:enchantment as compatible. However, if the enchantment is the same or does it conflict with any enchantment in the current list of enchantments in the result, it will no longer be considered compatible.

In other words, it's as if the enchanted book were in [[Minecraft:Enchantment_definition#JSON_format|Template:Cd]] for all enchantment definition, when we consider the anvil.


PotionSlot

Template:In development

Template:Infobox hip

mayPlaceItem(Template:Tooltip)

Returns true only if it is one of the four items listed above. Used to determine which items can be placed in the portion slot of the Minecraft:brewing stand.

It is also used in Template:Cd, so that these items are attempted to be moved from the inventory to the potion slot with a quick click (Template:Keys + click). Notes:

  • If the item is in the Template:Tag link tag, it will attempt to enter the fuel slot and not the potion slot (even if it fails to enter the fuel slot). The same occur with ingredients, however, ingredients are also hardcodedTemplate:Until and don't have intersection.
  • This prevents quick clicking from moving them between storage slots and hotbar slots and vice versa, when the brewing stand menu is open. Even if the itens fails to move to the potion slot.


CartographyTableMenu

Template:Infobox hip

mayPlace(Template:Tooltip) Template:Hatnote

Returns true only if it is one of the three items listed above. Used to determine which items can be placed in the slot 1 of the Minecraft:cartography table.

setupResultSlot(Template:Tooltip)

Used to define the result item of the cartography table:

  • If it's paper and the Template:Cd is not locked and has a scale less than 4, the resulting is one copy of the Template:Cd with the Template:DCL component set to 1 (SCALE).
  • If it's empty map, the resulting is two copy of the Template:Cd.

Note: It's possible to use the cartography table regardless of the Template:Cd ID; it only needs to have the Template:Cd component with data. However, when retrieving an item that the ID isn't filled_map with the Template:Cd component, the game crashes<ref>Template:Bug</ref>. However, using the empty map still works for item duplication.

quickMoveStack(Template:Tooltip)

When using the quick click (Template:Keys + click) in the inventory with the cartography table menu is open, it attempts to move these items to slot 1. Notes:

  • If the item has the Template:Cd component, it attempts to move it to slot 0 and does not go to slot 1 (even if it fails to go to slot 0).
  • This prevents quick clicking from moving them between storage slots and hotbar slots and vice versa, when the cartography table menu is open. Even if the itens fails to move to the slot 1.


EnchantmentMenu

Template:Infobox hip

Template:ItemSprite mayPlace(Template:Tooltip) Template:Hatnote

Only lapis lazuli can be placed in the slot 1 of Minecraft:enchantment table.

Template:ItemSprite clickMenuButton(Template:Tooltip)

Right before a book is enchanted on an enchantment table, it becomes an Minecraft:enchanted book.

Template:ItemSprite getEnchantmentList(Template:Tooltip)

When creating a list of enchantments to enchant a book on an enchantment table, remove one enchantment at random if the list has more than one enchantment.

Template:ItemSprite quickMoveStack(Template:Tooltip)

When using the quick click (Template:Key + click) in the inventory with the enchantment table menu is open, it attempts to move the lapis lazuli to slot 1. This prevents quick clicking from moving the lapis lazuli to slot 0.


FurnaceFuelSlot

Template:Infobox hip

isBucket(Template:Tooltip)

Check if the item is a bucket. Used twice to determine the behavior of the fuel slot (the lower left slot in blocks Minecraft:furnace, Minecraft:smoker, and Minecraft:blast furnace):

  • In Template:Cd, to allow the bucket to be used in the fuel slot, even if it is not Minecraft:fuel (it is possible for it to be if it is added to a certain tag).
    • This does not change the quick move. Because what is tested to determine if an item can have a quick move to the fuel slot is whether it is a fuel.
  • In Template:Cd, to limit the maximum number of buckets in the fuel slot to one.


GrindstoneMenu

Template:Infobox hip

removeNonCursesFrom(Template:Tooltip)

When using an enchanted book on the Minecraft:grindstone, after all non-curses enchantments have been removed, if the enchanted book does not retain an (curse) enchantment, it is transmuted into a Minecraft:book.


BeehiveBlock

Template:Infobox hip

useItemOn(Template:Tooltip)

It encodes the interaction of an item on a Minecraft:bee nest and on a Minecraft:beehive.

If the honey level is less than 5, or the item is not one of those listed below, the interaction returns 'try with empathy hand', otherwise returns success. The interaction depends on the item:

  • If the item is a shears, apply in the following order:
  • If is glass bottle, apply in the following order:
    • shrink the item by one;
    • the sound event bottle fill (Template:Cd) is played;
    • give the player a Minecraft:honey bottle, placing it in their hand if it's empty; otherwise, try placing it in their inventory. If that's not possible, the honey bottle is dropped;
    • and produce the game event Template:Cd.

For both items, after that, increases the item used Minecraft:statistic by one and test if the beehive is in the smoke. If not, proceed in the following order:

  • if there is at least one bee in the hive, each Minecraft:bee in a 17x13x17 area around the hive becomes aggressive toward a random player in the same area;
  • all the bees leave the hive and become aggressive toward the player.

Then, even if the beehive is in the smoke, the honey level is reduced to zero.


CandleCakeBlock

Template:Infobox hip

useItemOn(Template:Tooltip)

When interacting with an flint and steel or a fire charge on a cake with candle or a cake with dyed candle, the method immediately returns Template:Cd. The effect of these items on the cake is determined by Template:Cd in its classes (see Template:Slink, Template:Slink and Template:Slink).

This also prevents the player from trying to eat the cake, unlike all other items. Note that with these items, the player cannot eat the cake even if the candle is already lit.

ChiseledBookShelfBlock

Template:Infobox hip

addBook(Template:Tooltip)

When adding an enchanted book to the Minecraft:chiseled bookshelf, use Minecraft:sound event Template:Cd (Template:Sound) instead of Template:Cd (Template:Sound).

Note: The items that can be added to the chiseled bookshelf are controlled by the tag Template:Tag link, therefore it is not a hardcoded property.

removeBook(Template:Tooltip)

When remove an enchanted book to the chiseled bookshelf, use sound event Template:Cd (Template:Sound) instead of Template:Cd (Template:Sound).

ComposterBlock

Template:In development

Template:Infobox

bootStrap()

Define compostable items. In other words, items that, when interacting with the Minecraft:composter, can increase its level and they can be used with a Minecraft:hopper, Minecraft:minecart with hopper, and Minecraft:dropper to increase the composter level.

When the composting is at Template:Cd 0, all of these items will always increase its Template:Cd to 1.

If the composting Template:Cd are between 1 and 7, the chance of increasing its Template:Cd depends on the item's group. For the low, low mid, mid, mid high, and higt groups, the chances are 30%, 50%, 65%, 85% and 100% respectively. After interacting:

  1. If increasing the level: produce the Minecraft:game event Template:Cd;
  2. Player the Minecraft:sound event composter fill success (Template:Sound) if increasing the level, or the sound event composter fill (Template:Sound);
  3. Send composter particles;
  4. Increases the item Template:Cd Minecraft:statistic by one;
  5. Shrink one item of the item stack;
  6. Return Template:Cd.

When the composter reaches Template:Cd 7, it will automatically change to Template:Cd 8 in 20 ticks. Interacting with it will have no effect, but return 'success' iff the item is compostable.

Compostable items can be place through the top face of a compost, with Template:Cd < 7, using a hopper, minecart with hopper, and dropper. When an item is placed in the composter, try to increase the level, the following occurs 1, 2, and 3 above and it is removed from the internal slot.

When a Minecraft:villager inserts an item stack into the composter, it will only take effect if it is a compostable item (which is always the case since the items used are also hardcoded, see Template:Slink) and the composter is Template:Cd < 7. When it takes effect, it attempts to increase the level and occurs 1, 2, and 5 above.

When interacting with the composter at Template:Cd 8, the last level, regardless of what the player has on hand, the Minecraft:bone meal will be extracted and the composter will return to Template:Cd 0.

OutputContainer

Template:Infobox hip

canTakeItemThroughFace(Template:Tooltip)

Returns whether a Template:Cd 8 Minecraft:composter face can move an item to a Minecraft:hopper or Minecraft:minecart with hopper.

Returns true iff the face is dowm, the item to be removed is a bone meal, and no item has been removed from the container.

In practice, requiring the item to be bone meal doesn't change anything, as this is the only item that can be in the simple container, and this is hardcoded when generating the simple container. Although this may change with Minecraft:mods or future updates (such as composter extraction being controlled by a Minecraft:loot table).

Whenever a hopper is enabled and not full, it attempts to remove an item from the composter; even if it fails, the composter is emptied. For example, a hopper with a single redstone in each slot under a composter will empty it but won't extract anything.<ref>Template:Bug</ref>

LightBlock

Template:Infobox hip

getShape(Template:Tooltip)

Define the light block shape. The shape depends on the context; if the player is holding the light item, it will be a full block; otherwise, it will be empty.

PowderSnowBlock

Template:Infobox hip

canEntityWalkOnPowderSnow(Template:Tooltip)

Used in Template:Cd to help test whether the Minecraft:powder snow has a full block Minecraft:collision box.

Returns true iff the entity is in Template:Tag link tag or the entity is a living entity and has a leather border in the Template:Cd slot.

By Template:Cd the powder snow's collision box is empty by default, but it can change depending on the context:

  • If it is being placed or the context does not have an entity: empty
  • If the entity is falling for more than 2.5 blocks: A column of 16×14.4×16 pixels
  • If the entity is a falling block: Full block (16×16×16)
  • If the entity is above the block, isn't Minecraft:sneaking and Template:Cd: Full block (16×16×16)


PumpkinBlock

Template:Infobox hip

useItemOn(Template:Tooltip)

When using a shears on a Minecraft:pumpkin, instead of returning 'try_with_empty_hand' like other items, returning 'success' and occurs:


RespawnAnchorBlock

Template:Infobox hip

isRespawnFuel(Template:Tooltip)

Used in Template:Cd to test if the item is fuel for the Minecraft:respawn anchor. Returns true iff the item is a glowstone.

In Template:Cd, when use the glowstone on the respawn anchor with Template:Cd < 4, the following occurs:

If the player has glowstone in their offhand but in their mainhand, and is interacting with the mainhand, and the Template:Cd is less than 4, returns 'pass' instead of 'try with empty hand'. This prevents the setting respawn and exploding at the anchor at the same time.

SweetBerryBushBlock

Template:Infobox hip

useItemOn(Template:Tooltip)

If the item stack is a bone meal and the Minecraft:sweet berry bush's Template:Cd is not 3, the maximum, then return 'pass' instead of 'try with empty hand'. This causes the bone meal effect to be applied (see Template:Slink and Template:Slink) and prevents the attempt to harvest the sweet berry bush.

TntBlock

Template:Infobox hip

useItemOn(Template:Tooltip)

If the item used in Minecraft:TNT is one of these:

Otherwise, it returns 'try with empty hand' (but currently TNT has no effect on Template:Cd, thus is the same that return 'pass').

TripWireBlock

Template:Infobox hip

playerWillDestroy(Template:Tooltip)

When a player destroys a Minecraft:tripwire, just before it is removed, if the item in mainhand is a shears:

After the tripwire is broken, it updates the neighboring blocks as if it still existed and was Template:Cd true. This causes the Template:Tooltip Minecraft:tripwire hook to recalculate its stats, considering this wire as "wireSource". If Template:Cd is false, the tipwire hook will set its Template:Cd to true (because has a connected tripwire that is Template:Cd and not Template:Cd). If Template:Cd is true, because the disarmed tripwire is the "wireSource", it will set the tripwire hood's Template:Cd to false, and consequently set Template:Cd to false. In both cases, because there is a "wireSource", the tripwire hood will be recalculated its stats at 10 ticks (this time without a "wireSource", and probably resulting in both Template:Cd and Template:Cd false).

In other words, unless there are other tripwire interfering:


WeatheringCopperGolemStatueBlock

Template:Infobox hip

useItemOn(Template:Tooltip)

When using an item that is not in Template:Tag link in the Minecraft:copper golem statue, Minecraft:exposed copper golem statue, Minecraft:weathered copper golem statue, or Minecraft:oxidized copper golem statue:

If the item is in the tag Template:Cd:

  • If the block is (unaffected) copper golem statue it will try to generate a copper golem, if successful it will return Template:Cd.
  • Else, return Template:Cd.


WitherSkullBlock

Template:Infobox hip

canSpawnMob(Template:Tooltip)

Used to test if an item to be dispensed can be helpful in spawning the Minecraft:wither. For the item to be dispensed as a block, it is necessary that, in addition to this method returning true, that the Template:Cd (the target where the dispenser attempts to place the block) is Minecraft:air, cave air or void air.

Returns true if all the points below occur:

Template:BlockGrid

Requiring the item to be a wither skeleton skull is circular, since only the wither skeleton skull has the behavior in the dispenser to try to spawn the wither, and this behavior is also hardcoded (see Template:Slink). However, this property may be effective if in the future it becomes possible to customize item behaviors in the dispenser.

AbstractFurnaceBlockEntity

Template:Infobox hip

Define the behavior of Minecraft:block entity associated with a Minecraft:furnace, Minecraft:blast furnace and Minecraft:smoker.

Template:InvLink Template:ItemSprite burn(Template:Tooltip)

Used at the end of the Minecraft:smelting process, to add the result to output slot (slot 2).

After adding the result to output slot, if the item in ingredient slot (slot 0) is a wet sponge and the item in fuel slot (slot 1) is a bucket, set a water bucket in fuel slot.

After that, shrink 1 item from ingredient slot.

Template:ItemSprite Template:ItemSprite canTakeItemThroughFace(Template:Tooltip)

Tests whether the container item can be take by a Minecraft:hopper or Minecraft:minecart with hopper. Returns true only if the face is the down. If it's the fuel slot (slot 1), the item must also be a bucket or a bucket of water.

Note: the down face only gives access to fuel and output slots (slots 1 and 2), so only items from the slots can be take.

Template:ItemSprite canPlaceItem(Template:Tooltip)

Tests whether a hopper, minecart with hopper or a Minecraft:dropper can place item in the container.

It always returns true for ingredient slot (slot 0) and always returns false for output slots (slot 2).

For fuel slot (slot 1), it returns true if the item is fuel (see Template:Slink) or if the item is a bucket but there is no bucket already in the slot.

Note: the up face only gives access to ingredient slot (slot 0), and the side faces only give access to fuel slot (slot 1).

BrewingStandBlockEntity

Template:Infobox hip

Define the behavior of Minecraft:block entity associated with a Minecraft:brewing stand.

canPlaceItem(Template:Tooltip)Template:Until

Tests whether a Minecraft:hopper, Minecraft:minecart with hopper or Minecraft:dropper can place item in the container.

  • If it's slot 3, it returns if the item is a potion brewing ingredient (see Template:Slink),
  • If it's slot 4, it return true if the item is in the tag Template:Tag link,
  • If it's a potion slot (slot 0, 1 or 2), return true if the item is a potion, splash potion, lingering potion, or a glass bottle and the slot is empty

Note: the up face only gives access to slot 3; the side faces only give access to slots 0, 1, 2 and 4; and the down face only give access to slots 0, 1, 2 and 3.

Template:ItemSprite canTakeItemThroughFace(Template:Tooltip)

Tests whether the item in the container can be take by a hopper or minecart with hopper.

Returns true only if the slot is not the slot 3, or if the slot is 3 and the item is a glass bottle.

This was probably intended to take the glass bottle that could be obtained by using a single Minecraft:dragon's breath in slot 3, however, due to a bug, the craft remainder doesn't work in this situationTemplate:Note. Currently, it's only possible to place a glass bottle in slot 3 via command (like Template:Cmd).Template:Until

Note: The down face not give access to slot 4, since the hoppers only try to take items from the down face, they should never take items from slot 4.

DecoratedPotPatterns

Template:In development Template:Infobox hip Template:Tooltip

Associates each item idTemplate:Note with a decorated pot pattern, which is associated with a texture in Template:Mono.

Used for Minecraft:decorated pot block model, with the Template:DCL component. Used in the Template:Cd item model, type [[Minecraft:Items_model_definition#decorated_pot|Template:Cd]].

For items that do not have a pattern or when they is empty in one side, the texture Template:Mono is used; therefore, this property currently has no effect on the brick.

Item Pattern Asset ID Texture
Template:ItemLink blank Template:Mono File:Decorated Pot (side texture).png
Template:ItemLink angler Template:Mono File:Angler Pottery Pattern (texture).png
Template:ItemLink archer Template:Mono File:Archer Pottery Pattern (texture).png
Template:ItemLink arms_up Template:Mono File:Arms Up Pottery Pattern (texture).png
Template:ItemLink blade Template:Mono File:Blade Pottery Pattern (texture).png
Template:ItemLink brewer Template:Mono File:Brewer Pottery Pattern (texture).png
Template:ItemLink burn Template:Mono File:Burn Pottery Pattern (texture).png
Template:ItemLink danger Template:Mono File:Danger Pottery Pattern (texture).png
Template:ItemLink explorer Template:Mono File:Explorer Pottery Pattern (texture).png
Template:ItemLink flow Template:Mono File:Flow Pottery Pattern (texture).png
Template:ItemLink friend Template:Mono File:Friend Pottery Pattern (texture).png
Template:ItemLink guster Template:Mono File:Guster Pottery Pattern (texture).png
Template:ItemLink heart Template:Mono File:Heart Pottery Pattern (texture).png
Template:ItemLink heartbreak Template:Mono File:Heartbreak Pottery Pattern (texture).png
Template:ItemLink howl Template:Mono File:Howl Pottery Pattern (texture).png
Template:ItemLink miner Template:Mono File:Miner Pottery Pattern (texture).png
Template:ItemLink mourner Template:Mono File:Mourner Pottery Pattern (texture).png
Template:ItemLink plenty Template:Mono File:Plenty Pottery Pattern (texture).png
Template:ItemLink prize Template:Mono File:Prize Pottery Pattern (texture).png
Template:ItemLink scrape Template:Mono File:Scrape Pottery Pattern (texture).png
Template:ItemLink sheaf Template:Mono File:Sheaf Pottery Pattern (texture).png
Template:ItemLink shelter Template:Mono File:Shelter Pottery Pattern (texture).png
Template:ItemLink skull Template:Mono File:Skull Pottery Pattern (texture).png
Template:ItemLink snort Template:Mono File:Snort Pottery Pattern (texture).png


FuelValues

Template:In development

Template:Infobox hip

vanillaBurnTimes(Template:Tooltip)

Used to set the time and which items can be used as Minecraft:fuel. Added both directly to items, item tags, and blocks as items (see Template:Slink).

When an item appears twice, for example because it's in a tag, the last value is used, according to the table below.

Adding any item to tag Template:Tag link causes it to cease being a fuel item.

Only lava bucket, Minecraft:block of coal, blaze rod, coal, charcoal, Minecraft:dried kelp block, Minecraft:bambooTemplate:Until and Minecraft:scaffoldingTemplate:Until have times that cannot be added to any other item via tags.

Note that the higher up in the table, or when it doesn't belong to the table, the more customizable the item is, as its value can be substituted from a tag. Ironically, most hardcoded fuels have less customizable fuel time than other items. Tags with a green or orange background are the most suitable for adding items, as they can change a greater number of items. Items below these tags cannot have the fuel value given by them. Tags with an orange background are also used in other places, however, they are only used in the vanilla datapack, making it easy to substitute other uses.

Many fuel times exist for both items and tags, but some are exclusive to items, giving items with that time a unique property. Times marked in dark green are unique to a certain item, while light green times are unique to items, but more than one item has that time. There are also times unique to tags, marked in gray.

Only items Minecraft:bamboo mosaic, Minecraft:bamboo mosaic stairs, and Minecraft:bamboo mosaic slab are hardcoded fuel items and can be as customizable as a non-hardcoded fuel item and do not have a unique time.

Items Time
Template:Tooltip Ticks
Template:ItemLink Template:Tc Template:Tc
Template:BlockLink Template:Tc Template:Tc
Template:ItemLink Template:Tc Template:Tc
Template:ItemLink Template:Tc Template:Tc
Template:ItemLink Template:Tc Template:Tc
Template:BlockSprite Template:Tag link Template:Frac 300
Template:BlockSprite Template:Tag link Template:Frac 300
Template:BlockSprite Template:Tag link Template:Frac 300
Template:BlockLink Template:Frac 300
Template:BlockSprite Template:Tag link Template:Frac 300
Template:BlockLink Template:Frac 300
Template:Tc Template:Frac 50
Template:BlockLink Template:Frac 50
Template:BlockSprite Template:Tag link Template:Frac 300
Template:BlockSprite Template:Tag link Template:Frac 300
Template:BlockSprite Template:Tag link Template:Frac 300
Template:BlockSprite Template:Tag link Template:Frac 300
Template:Tc Template:Frac 300
Template:BlockLink Template:Frac 300
Template:BlockLink Template:Frac 300
Template:BlockLink Template:Frac 300
Template:BlockLink Template:Frac 300
Template:BlockLink Template:Frac 300
Template:BlockLink Template:Frac 300
Template:BlockLink Template:Frac 300
Template:BlockLink Template:Frac 300
Template:BlockLink Template:Frac 300
Template:ItemSprite Template:Tag link Template:Frac 300
Template:ItemLink Template:Frac 300
Template:ItemLink Template:Frac 300
Template:BlockLink Template:Frac 300
Template:Tc* 1 200
Template:Tc Template:Tc Template:Tc
Template:ItemLink 1 200
Template:ItemLink 1 200
Template:ItemLink 1 200
Template:ItemLink 1 200
Template:ItemLink 1 200
Template:ItemLink 1 200
Template:BlockSprite Template:Tag link 1 200
Template:Tc Template:Tc Template:Tc
Template:BlockSprite Template:Tag link Template:Frac 100
Template:BlockSprite Template:Tag linkTemplate:Upcoming Template:Frac 100
Template:Tc Template:Frac 50
Template:BlockSprite Template:Tag link Template:Frac 100
Template:ItemLink Template:Frac 100
Template:Tc Template:Frac 100
Template:ItemLink Template:Frac 100
Template:Tc Template:Tc Template:Tc
Template:BlockLink Template:Tc Template:Tc
Template:ItemLink Template:Frac 300
Template:BlockLink* Template:Tc Template:Tc
Template:BlockLink Template:Frac 100
Template:BlockLink Template:Frac 100
Template:BlockLink Template:Frac 100
Template:BlockLink* Template:Tc Template:Tc
Template:BlockLink Template:Frac 300
Template:BlockLink Template:Frac 300
Template:BlockLink Template:Frac 300
Template:BlockLink Template:Frac 300
Template:BlockLink Template:Frac 300
Template:BlockLink Template:Frac 300
Template:BlockLink Template:Frac 100
Template:BlockLink Template:Frac 100
Template:BlockLink Template:Frac 300
Template:BlockLink Template:Frac 100
Template:Tc<in: JE 26.3-snap3></in: JE 26.3-snap3> 1 200

* Lines marked with asterisks no longer have a background color in JE 26.3-snap1 or JE 26.3-snap3.

The fuel list is used in:

  • Template:Jcp.Template:Cd: Used to allow fuel o be moved from the inventory to the fuel slot (slot 1) with a quick click (Template:Keys + click), in any furnace.
    • If the item can smelt, it will attempt to go to the ingredient slot (slot 0), and not to the fuel slot (slot 1).
    • This also prevents quick clicking from moving fuel to the between storage slots (slots 3–29) and hotbar slots (slots 30–38) and vice versa, when the any furnace menu is open. Even if the fuel fails to move to the fuel slot.
  • Template:Jcp.Template:Cd: Used to enable fuel to be placed in the fuel slot, by the menu, in any furnace.
  • Template:Jbcp.Template:Cd: Used to enable fuel to be placed in the fuel slot, by Minecraft:hopper, Minecraft:minecart with hopper and Minecraft:dropper, in any furnace.
  • Template:Jbcp.Template:Cd: Return the burn duration time (in ticks)
    • Used in Template:Cd, so that if the block is not Template:Cd, it has fuel, an ingredient, and the recipe is available, then:
      • it defines the Template:Cd and the Template:Cd;
      • if it is greater than 0, it consumes the fuel (shrinks 1 item from the item stack and leaves the craft remaining if it is the last one), set the Template:Cd true (included for effects in this same metody).
    • In implementations Template:Jbcp and Template:Jbcp, returns half the time (rounding down). However, in the vanilla datapack, the recipes in that block take 100 ticks instead of 200 ticks, so the quantity of smelted items is approximately the same (it changes slightly for items in Template:Cd tag and for the dried kelp block, where in the Minecraft:furnace it is respectively 0.335 and 20.005 items and in Minecraft:smoker and Minecraft:blast furnace it is respectively 0.33 and 20 items).


PotDecorations

Template:In development

Template:Infobox hip

getItem(Template:Tooltip)

Returns the Template:Cd-th item from the list Template:Cd given when set the Template:DCL component. If Template:Cd is greater or equal than the size of Template:Cd, returns Template:Cd. If the Template:Cd-th item is a brick, returns Template:Cd; otherwise, returns the item itself.

Used to define the component Template:Cd internally. Therefore, the items stack Template:Cd and Template:Cd are the same. The same applies to Template:Cd and Template:Cd.

This also means that the pot crafted using the Template:Cd recipe, with just bricks, and the Template:Cd (craftable via the recipe book) result in the same item.

However, sometimes when using the component it does the opposite (it considers the empty space as a brick):


VaultConfig

Template:Infobox hip

VaultConfig()

Define the default Template:Cd in the Template:Cd in Template:Cd Minecraft:block entity as trial key. So the tiral key can open Minecraft:vaults whose Template:Cd has not been changed.

However, it is possible to change the Template:Cd using commands, this key property only applies to default vaults.

AgeableMob

Template:Infobox hip

canUseGoldenDandelion(Template:Tooltip)

Returns true when the following occur simultaneously:

This method is used twice:

  • Template:Jcp.Template:Cd — The Template:Cd parameter is always true, and the Template:Cd is the same as above. Before testing whether the golden dandelion works, try feeding the tadpole (feed it when the item is in the Template:Tag link tag and the tadpole is not age-locked). If it doesn't feed, try using the golden dandelion; if successful, set it to age-locked and return it to the Template:Cd. Otherwise, try to catch the tadpole in the bucket.

When age locked is set, it occurs in order:

  1. Invert the value of the NBT tag Template:Cd;
  2. Sets the Template:Cd to 0 for tadpoles, −48000 for sniffers, and −24000 for other mobs;
  3. Set Template:Cd to 40;
  4. Consume one item from the player's hand.
  5. If age is locked:
Otherwise

Entity

Template:Infobox hip


interact(Template:Tooltip)

Attempt to interact with the entity in the following order. If one attempt fails, try the next.

1. The player attempts to attach entities currently leashed to them onto the entity being interacted with. This interaction does not depend on the item held in hand. If at least one entity is successfully leashed, the interaction returns success (and concludes).

2. If the item held is shears, attempt to remove the leashes from the entity being interacted with.

  • This attempts to remove both the leash securing the interacted entity and any leashes from nearby entities (within a 32×32×32 cuboid centered on the interacted entity) that are attached to the interacted entity.
  • When a leash is removed, it is dropped at the position of the leashed entity.

If at least one leash is dropped:

3. Attempts to remove equipment from the entity. This is only possible if the following conditions are met simultaneously:

  • The entity is a Minecraft:mob
  • The player is holding shears
  • The player is not [[Minecraft:crouching|Template:Control]]
  • If the entity is a wolf, the player is its owner; otherwise, the entity is not being ridden
  • At least one item in the entity's equipment slots has Template:DCL set to true and, unless the player is in Creative mode, does not have an enchantment with Template:Cd effect components (e.g., Minecraft:Curse of Binding in vanilla)

In this case, a piece of equipment can be removed:

  • The shears take one of damage
  • Produce the Minecraft:game event Template:Cd
  • Drop the equipment
  • Triggered [[Minecraft:Advancement_definition#minecraft:player_sheared_equipment|Template:Cd]] advancement trigger
  • The interaction returns success.

At most, one piece of equipment is dropped at a time, in the following order of slot priority: mainhand, offhand, feet, legs, chest, head, body and saddle.

4. wip

LivingEntity

Mob

CrossbowAttack

TradeWithVillager

UseBonemeal

WorkAtComposter

BegGoal

BowAttackGoal

RangedCrossbowAttackGoal

Bucketable

Armadillo

Axolotl

Camel

AbstractCow

MushroomCow

AbstractChestedHorse

AbstractHorse

Horse

Llama

Goat

CopperGolem

IronGolem

SnowGolem

Panda

Pig

Sheep

Wolf

ArmorStand

LeashFenceKnotEntity

Creeper

CrossbowAttackMob

Strider

Illusioner

Pillager

Piglin

PiglinAi

PiglinBrute

AbstractSkeleton

Bogged

Drowned

DrownedTridentAttackGoal

Zombie

ZombieVillager

Villager

VillagerProfession

WanderingTrader

Player

FireworkRocketEntity

FishingHook

ProjectileUtil

EntityEquipmentPredicate

ClientLevel

AbstractClientPlayer

ItemInHandRenderer

AbstractSkeletonRenderer

DrownedRenderer

LivingEntityRenderer

WitchRenderer

AvatarRenderer

CuboidItemModelWrapper

Charge

PotionBrewing

Template:In development

Ingredient

CrossbowItem

EnchantmentHelper

Item (member access)

ItemStack

ItemStackTemplate

ProjectileWeaponItem

EnchantRandomlyFunction

ExplorationMapFunction

FillPlayerHead

SetEnchantmentsFunction

SetStewEffectFunction

Old article stub

Template:Msgbox

List

Template:Collapse

History

Template:Info needed section

Template:HistoryTable

Notes

Template:Notelist

References

Template:Reflist

Contents