API reference / @jsprismarine/prismarine / item/Item
item/Item
Classes
Interfaces
ItemProps
Defined in: packages/prismarine/src/item/Item.ts:52
Properties
blockRuntimeId?
optionalblockRuntimeId?:number
Defined in: packages/prismarine/src/item/Item.ts:65
The runtime id of the block state this stack places, when the name alone would get it wrong. Vanilla's creative menu shows a piston facing up and sends a door with no block at all, so a creative entry passes its own number rather than resolving its default state.
canDestroyBlocks?
optionalcanDestroyBlocks?: readonlystring[]
Defined in: packages/prismarine/src/item/Item.ts:80
Bedrock block identifiers this stack may destroy in adventure mode.
canPlaceOnBlocks?
optionalcanPlaceOnBlocks?: readonlystring[]
Defined in: packages/prismarine/src/item/Item.ts:78
Bedrock block identifiers this stack may be placed on in adventure mode.
components?
optionalcomponents?:Readonly<Record<string,unknown>>
Defined in: packages/prismarine/src/item/Item.ts:95
The stack's other Java data components, such as minecraft:trim or minecraft:firework_explosion; see Item.getComponents. A component the other props hold is left out.
content?
optionalcontent?:ServerContent
Defined in: packages/prismarine/src/item/Item.ts:67
The content the item's components are read from, when the server built one.
contents?
optionalcontents?: readonly (Item|null)[]
Defined in: packages/prismarine/src/item/Item.ts:87
What a container item holds, one entry per slot and null for an empty one.
Java's minecraft:container. A shulker box carries its whole inventory here between being broken and being placed again.
count?
optionalcount?:number
Defined in: packages/prismarine/src/item/Item.ts:58
customName?
optionalcustomName?:string
Defined in: packages/prismarine/src/item/Item.ts:74
The name an anvil gave the stack, which replaces the item's own on the client.
durability?
optionaldurability?:number
Defined in: packages/prismarine/src/item/Item.ts:59
enchantments?
optionalenchantments?:Readonly<Record<string,number>> |ReadonlyMap<string,number>
Defined in: packages/prismarine/src/item/Item.ts:72
Enchantments on the stack, as Java's minecraft:enchantments component holds them: namespaced enchantment id to level.
lore?
optionallore?: readonlystring[]
Defined in: packages/prismarine/src/item/Item.ts:76
The lines an item modifier wrote under the name.
mapId?
optionalmapId?:number
Defined in: packages/prismarine/src/item/Item.ts:89
Which saved map a filled map shows, Java's minecraft:map_id; see Item.getMapId.
meta?
optionalmeta?:number
Defined in: packages/prismarine/src/item/Item.ts:56
name
name:
string
Defined in: packages/prismarine/src/item/Item.ts:55
nbt?
optionalnbt?:unknown
Defined in: packages/prismarine/src/item/Item.ts:57
runtimeId?
optionalruntimeId?:number
Defined in: packages/prismarine/src/item/Item.ts:54
The Bedrock runtime id to retain when the item name is not in the vanilla table.
Functions
maxStackSizeOf()
maxStackSizeOf(
name,content?):number
Defined in: packages/prismarine/src/item/Item.ts:136
The most of one item a stack holds, from minecraft:max_stack_size.
Parameters
name
string
The item identifier.
content?
The content build; Java's committed table when absent.
Returns
number
The stack size.
resistsDamageOf()
resistsDamageOf(
name,damage,content?):boolean
Defined in: packages/prismarine/src/item/Item.ts:148
Whether a dropped stack of an item survives a kind of damage, from Java's minecraft:damage_resistant: netherite names #minecraft:is_fire and a nether star #minecraft:is_explosion.
Parameters
name
string
The item identifier.
damage
string
The damage type tag, such as minecraft:is_fire, or a damage type.
content?
The content build; Java's committed table when absent.
Returns
boolean
Whether the stack survives it.