Skip to main content

Protocol: ItemStackData

Serializable, typed snapshot accepted by ItemStack.from_data.

class ItemStackData(Protocol)

Related API: Vector3, Vector3Mapping

Properties

type_id

@property
def type_id(self) -> str:

Namespaced item type identifier.

amount

@property
def amount(self) -> int:

Number of items in the stack.

name_tag

@property
def name_tag(self) -> str:

Effective display name returned by Minecraft.

lore

@property
def lore(self) -> Sequence[str]:

Lore lines in display order.

data

@property
def data(self) -> Mapping[str, Union[bool, float, str, Vector3, Vector3Mapping]]:

QuestScript data stored on the stack.

Related API: Vector3, Vector3Mapping

damage

@property
def damage(self) -> int:

Current durability damage.

enchantments

@property
def enchantments(self) -> Mapping[str, int]:

Enchantment levels keyed by namespaced enchantment identifier.

can_destroy

@property
def can_destroy(self) -> Sequence[str]:

Adventure-mode block predicates stored in CanDestroy.

can_place_on

@property
def can_place_on(self) -> Sequence[str]:

Adventure-mode block predicates stored in CanPlaceOn.

tags

@property
def tags(self) -> Sequence[str]:

Sorted Minecraft item tags derived from type_id.