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 Details

    • CONSUMABLE

      static final ItemDataComponent<JavaConsumable> CONSUMABLE
      Marks the item as consumable. Of this component, only consume_seconds and animation properties 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

      static final ItemDataComponent<JavaEquippable> EQUIPPABLE
      Marks the item as equippable. Of this component, only the slot property is translated. Other properties are done server-side, are done differently on Bedrock (e.g. asset_id is 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

      static final ItemDataComponent<Integer> 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

      static final ItemDataComponent<Integer> 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

      static final ItemDataComponent<JavaUseCooldown> 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

      static final ItemDataComponent<Integer> 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:enchantable bedrock component with slot=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

      static final ItemDataComponent<JavaTool> TOOL
      For vanilla-item overrides, this component is only used for the JavaTool.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

      static final ItemDataComponent<JavaRepairable> REPAIRABLE
      Marks which items can be used to repair the item.
      Since:
      2.9.3
      See Also:
    • ENCHANTMENT_GLINT_OVERRIDE

      static final ItemDataComponent<Boolean> ENCHANTMENT_GLINT_OVERRIDE
      Overrides the item's enchantment glint.
      Since:
      2.9.3
    • ATTACK_RANGE

      static final ItemDataComponent<JavaAttackRange> ATTACK_RANGE
      Specifies the attack ranges of an item. Due to Bedrock limitations, only has an effect in combination with the KINETIC_WEAPON or PIERCING_WEAPON components.
      Since:
      2.9.3
      See Also:
    • KINETIC_WEAPON

      static final ItemDataComponent<JavaKineticWeapon> 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

      static final ItemDataComponent<JavaPiercingWeapon> 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

      static final ItemDataComponent<JavaSwingAnimation> 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

      static final ItemDataComponent<JavaUseEffects> USE_EFFECTS
      Specifies how the player behaves when using the item. Due to Bedrock limitations, the can_sprint property cannot be translated.
      Since:
      2.9.3
      See Also: