Package org.geysermc.geyser.item.type
Class Item
java.lang.Object
org.geysermc.geyser.item.type.Item
- Direct Known Subclasses:
ArmorItem,ArrowItem,AxolotlBucketItem,BlockItem,BoatItem,CompassItem,CrossbowItem,DyeItem,ElytraItem,EnchantedBookItem,FireworkRocketItem,FireworkStarItem,FishingRodItem,GoatHornItem,MaceItem,MapItem,PlayerHeadItem,PotionItem,ShieldItem,SpawnEggItem,TieredItem,TropicalFishBucketItem,WritableBookItem,WrittenBookItem
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintstatic Item.Builderbuilder()booleanisValidRepairItem(Item other) intjavaId()intintnewItemStack(int count, org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponents components) protected final @Nullable org.cloudburstmc.nbt.NbtMapremapEnchantment(GeyserSession session, int enchantId, int level, BedrockItemBuilder builder) voidsetJavaId(int javaId) toBedrockDefinition(org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponents components, ItemMappings mappings) toString()voidtranslateComponentsToBedrock(@NonNull GeyserSession session, @NonNull org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponents components, @NonNull BedrockItemBuilder builder) Takes components from Java Edition and map them into Bedrock.voidtranslateNbtToJava(@NonNull org.cloudburstmc.nbt.NbtMap bedrockTag, @NonNull org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponents components, @NonNull ItemMapping mapping) Takes NBT from Bedrock Edition and converts any value that Java parses differently.org.cloudburstmc.protocol.bedrock.data.inventory.ItemData.BuildertranslateToBedrock(int count, org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponents components, ItemMapping mapping, ItemMappings mappings) @NonNull GeyserItemStacktranslateToJava(@NonNull org.cloudburstmc.protocol.bedrock.data.inventory.ItemData itemData, @NonNull ItemMapping mapping, @NonNull ItemMappings mappings)
-
Constructor Details
-
Item
-
-
Method Details
-
javaIdentifier
-
javaId
public int javaId() -
maxDamage
public int maxDamage() -
attackDamage
public int attackDamage() -
maxStackSize
public int maxStackSize() -
isValidRepairItem
-
translateToBedrock
public org.cloudburstmc.protocol.bedrock.data.inventory.ItemData.Builder translateToBedrock(int count, org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponents components, ItemMapping mapping, ItemMappings mappings) -
translateToJava
public @NonNull GeyserItemStack translateToJava(@NonNull org.cloudburstmc.protocol.bedrock.data.inventory.ItemData itemData, @NonNull ItemMapping mapping, @NonNull ItemMappings mappings) -
toBedrockDefinition
public ItemMapping toBedrockDefinition(org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponents components, ItemMappings mappings) -
translateComponentsToBedrock
public void translateComponentsToBedrock(@NonNull GeyserSession session, @NonNull org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponents components, @NonNull BedrockItemBuilder builder) Takes components from Java Edition and map them into Bedrock. -
translateNbtToJava
public void translateNbtToJava(@NonNull org.cloudburstmc.nbt.NbtMap bedrockTag, @NonNull org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponents components, @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
-
remapEnchantment
protected final @Nullable org.cloudburstmc.nbt.NbtMap remapEnchantment(GeyserSession session, int enchantId, int level, BedrockItemBuilder builder) -
newItemStack
public GeyserItemStack newItemStack(int count, org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponents components) -
setJavaId
public void setJavaId(int javaId) -
toString
-
builder
-