Interface JavaItemDataComponents
public interface JavaItemDataComponents
Represents various Java item data components to the extent
that these can be translated to custom items for Bedrock edition players.
These can be set in
CustomItemDefinition.Builder.component(ItemDataComponent, Object)
to specify the item's behavior. It's expected that these components would also
be present on the item server-side to avoid de-syncs.- Since:
- 2.9.3
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ItemDataComponent<JavaAttackRange>Specifies the attack ranges of an item.static final ItemDataComponent<JavaConsumable>Marks the item as consumable.static final ItemDataComponent<Integer>Marks the item to be enchantable.static final ItemDataComponent<Boolean>Overrides the item's enchantment glint.static final ItemDataComponent<JavaEquippable>Marks the item as equippable.static final ItemDataComponent<JavaFoodProperties>Food properties of the item.static final ItemDataComponent<JavaKineticWeapon>Specifies a spear-like attack when the item is in use.static final ItemDataComponent<Integer>Max damage value of the item.static final ItemDataComponent<Integer>Max stack size of the item.static final ItemDataComponent<JavaPiercingWeapon>Specifies a stab-like attack when using the item.static final ItemDataComponent<JavaRepairable>Marks which items can be used to repair the item.static final ItemDataComponent<JavaSwingAnimation>Specifies the swing animation to play when attacking or interacting using the item.static final ItemDataComponent<JavaTool>For vanilla-item overrides, this component is only used for theJavaTool.canDestroyBlocksInCreative()option.static final ItemDataComponent<JavaUseCooldown>Marks the item to have a use cooldown.static final ItemDataComponent<JavaUseEffects>Specifies how the player behaves when using the item.
-
Field Details
-
CONSUMABLE
Marks the item as consumable. Of this component, onlyconsume_secondsandanimationproperties are translated. Consume effects are done server side, and consume sounds and disabling consume particles aren't possible.Note that due to a bug on Bedrock, not all consume animations appear perfectly. See
JavaConsumable.Animation.- Since:
- 2.9.3
- See Also:
-
EQUIPPABLE
Marks the item as equippable. Of this component, only theslotproperty is translated. Other properties are done server-side, are done differently on Bedrock (e.g.asset_idis done via attachables), or are not possible on Bedrock at all (e.g.camera_overlay).Note that on Bedrock, equippables can't have a stack size above 1.
- Since:
- 2.9.3
- See Also:
-
FOOD
Food properties of the item. All properties properly translate over to Bedrock.- Since:
- 2.9.3
- See Also:
-
MAX_DAMAGE
Max damage value of the item. Must be at or above 0. Items with a max damage value above 0 cannot have a stack size above 1.- Since:
- 2.9.3
-
MAX_STACK_SIZE
Max stack size of the item. Must be between 1 and 99. Items with a max stack size value above 1 cannot have a max damage value above 0.- Since:
- 2.9.3
-
USE_COOLDOWN
Marks the item to have a use cooldown. To properly function, the item must be able to be used: it must be consumable or have some other kind of use logic.The cooldown group can be
null, in this case the identifier of the vanilla item (in case of vanilla custom items), or the item itself (in case of non-vanilla custom items) will be used.- Since:
- 2.9.3
- See Also:
-
ENCHANTABLE
Marks the item to be enchantable. Must be at or above 0.This component does not translate over perfectly, due to the way enchantments work on Bedrock. The component will be mapped to the
minecraft:enchantablebedrock component withslot=all, and an enchantable value of what this component was set to. This should, but does not guarantee, allow for compatibility with vanilla enchantments. Non-vanilla enchantments are unlikely to work.- Since:
- 2.9.3
-
TOOL
For vanilla-item overrides, this component is only used for theJavaTool.canDestroyBlocksInCreative()option. For non-vanilla custom items, this component also stores the tool's rules and default mining speed, to correctly calculate block breaking speed.- Since:
- 2.9.3
- See Also:
-
REPAIRABLE
Marks which items can be used to repair the item.- Since:
- 2.9.3
- See Also:
-
ENCHANTMENT_GLINT_OVERRIDE
Overrides the item's enchantment glint.- Since:
- 2.9.3
-
ATTACK_RANGE
Specifies the attack ranges of an item. Due to Bedrock limitations, only has an effect in combination with theKINETIC_WEAPONorPIERCING_WEAPONcomponents.- Since:
- 2.9.3
- See Also:
-
KINETIC_WEAPON
Specifies a spear-like attack when the item is in use. Only properties required on the Bedrock client are translated.- Since:
- 2.9.3
- See Also:
-
PIERCING_WEAPON
Specifies a stab-like attack when using the item. Only properties required on the Bedrock client are translated.- Since:
- 2.9.3
- See Also:
-
SWING_ANIMATION
Specifies the swing animation to play when attacking or interacting using the item. Due to Bedrock limitations, the actual animation played cannot be specified, only the duration of the animation.- Since:
- 2.9.3
- See Also:
-
USE_EFFECTS
Specifies how the player behaves when using the item. Due to Bedrock limitations, thecan_sprintproperty cannot be translated.- Since:
- 2.9.3
- See Also:
-