Interface InventorySlotOrBuilder
- All Superinterfaces:
com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder
- All Known Implementing Classes:
InventorySlot, InventorySlot.Builder
@Generated
public interface InventorySlotOrBuilder
extends com.google.protobuf.MessageOrBuilder
-
Method Summary
Modifier and TypeMethodDescriptionintgetCount()The number of items in this stack.The custom display name of the item, if it has been renamed.com.google.protobuf.ByteStringThe custom display name of the item, if it has been renamed.The Minecraft item identifier in namespaced format.com.google.protobuf.ByteStringThe Minecraft item identifier in namespaced format.intgetSlot()The slot index within the container.booleanThe custom display name of the item, if it has been renamed.Methods inherited from interface com.google.protobuf.MessageLiteOrBuilder
isInitializedMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getDefaultInstanceForType, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Method Details
-
getSlot
int getSlot()The slot index within the container. - For container menus: 0 to (total_slots - 1) - For player inventory: 0-4 crafting, 5-8 armor, 9-35 main inventory, 36-44 hotbar, 45 offhand - For carried items (cursor): -1 is used as a special indicator
int32 slot = 1;- Returns:
- The slot.
-
getItemId
String getItemId()The Minecraft item identifier in namespaced format. Examples: "minecraft:diamond_sword", "minecraft:stone", "minecraft:enchanted_book"
string item_id = 2;- Returns:
- The itemId.
-
getItemIdBytes
com.google.protobuf.ByteString getItemIdBytes()The Minecraft item identifier in namespaced format. Examples: "minecraft:diamond_sword", "minecraft:stone", "minecraft:enchanted_book"
string item_id = 2;- Returns:
- The bytes for itemId.
-
getCount
int getCount()The number of items in this stack. Range: 1 to the item's maximum stack size (typically 1, 16, or 64).
int32 count = 3;- Returns:
- The count.
-
hasDisplayName
boolean hasDisplayName()The custom display name of the item, if it has been renamed. Only present when the item has a custom name component (e.g., renamed in an anvil). Contains the plain text string, not JSON text components.
optional string display_name = 4;- Returns:
- Whether the displayName field is set.
-
getDisplayName
String getDisplayName()The custom display name of the item, if it has been renamed. Only present when the item has a custom name component (e.g., renamed in an anvil). Contains the plain text string, not JSON text components.
optional string display_name = 4;- Returns:
- The displayName.
-
getDisplayNameBytes
com.google.protobuf.ByteString getDisplayNameBytes()The custom display name of the item, if it has been renamed. Only present when the item has a custom name component (e.g., renamed in an anvil). Contains the plain text string, not JSON text components.
optional string display_name = 4;- Returns:
- The bytes for displayName.
-