Class Item

java.lang.Object
org.geysermc.geyser.item.type.Item
Direct Known Subclasses:
ArmorItem, ArrowItem, AxolotlBucketItem, BlockItem, BoatItem, CompassItem, CrossbowItem, DyeableHorseArmorItem, DyeItem, ElytraItem, EnchantedBookItem, FireworkRocketItem, FireworkStarItem, FishingRodItem, GoatHornItem, MapItem, PlayerHeadItem, PotionItem, ReadableBookItem, ShieldItem, SpawnEggItem, TieredItem, TropicalFishBucketItem

public class Item extends Object
  • Constructor Details

  • Method Details

    • javaIdentifier

      public String javaIdentifier()
    • javaId

      public int javaId()
    • maxDamage

      public int maxDamage()
    • maxStackSize

      public int maxStackSize()
    • isValidRepairItem

      public boolean isValidRepairItem(Item other)
    • translateToBedrock

      public org.cloudburstmc.protocol.bedrock.data.inventory.ItemData.Builder translateToBedrock(com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack itemStack, ItemMapping mapping, ItemMappings mappings)
    • translateToJava

      public com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack translateToJava(org.cloudburstmc.protocol.bedrock.data.inventory.ItemData itemData, ItemMapping mapping, ItemMappings mappings)
    • toBedrockDefinition

      public ItemMapping toBedrockDefinition(com.github.steveice10.opennbt.tag.builtin.CompoundTag nbt, ItemMappings mappings)
    • translateNbtToBedrock

      public void translateNbtToBedrock(@NonNull GeyserSession session, @NonNull com.github.steveice10.opennbt.tag.builtin.CompoundTag tag)
      Takes NBT from Java Edition and converts any value that Bedrock parses differently.
    • translateNbtToJava

      public void translateNbtToJava(@NonNull com.github.steveice10.opennbt.tag.builtin.CompoundTag tag, @NonNull ItemMapping mapping)
      Takes NBT from Bedrock Edition and converts any value that Java parses differently.
      Do note that this method is, these days, only called in three places (as of 2023/~1.19):
      • Extra recipe loading
      • Creative menu
      • Stonecutters
      Therefore, if translation cannot be achieved for a certain item, it is not necessarily bad.
    • remapEnchantment

      protected final com.github.steveice10.opennbt.tag.builtin.CompoundTag remapEnchantment(GeyserSession session, com.github.steveice10.opennbt.tag.builtin.CompoundTag tag, com.github.steveice10.opennbt.tag.builtin.CompoundTag rootTag)
    • newItemStack

      public com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack newItemStack(int count, com.github.steveice10.opennbt.tag.builtin.CompoundTag tag)
    • setJavaId

      public void setJavaId(int javaId)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • builder

      public static Item.Builder builder()