This property can't be edited in read-only mode.
This property can't be read in early-execution mode.
ReadonlyisThis property can't be edited in read-only mode.
This property can't be read in early-execution mode.
ReadonlylocalizationThis property can't be read in early-execution mode.
This property can't be edited in read-only mode.
This property can't be read in early-execution mode.
ReadonlymaxOptionalnameThis property can't be edited in read-only mode.
This property can't be read in early-execution mode.
ReadonlytypeReadonlytypeReadonlyweightThis function can't be called in read-only mode.
This function can't be called in early-execution mode.
This function can't be called in read-only mode.
This function can't be called in early-execution mode.
This function can't be called in read-only mode.
This function can't be called in early-execution mode.
This function can't be called in read-only mode.
This function can't be called in early-execution mode.
This function can't be called in read-only mode.
This function can't be called in early-execution mode.
import { world } from "@minecraft/server";
const player = world.getPlayers()[0];
const inventory = player.getComponent("inventory");
const slot = inventory.container.getSlot(player.selectedSlotIndex);
let durabilityComp = slot.getItem().getComponent("durability");
player.sendMessage(
"Item Durability: " + (durabilityComp.maxDurability - durabilityComp.damage) + "/" + durabilityComp.maxDurability
);
This function can't be called in read-only mode.
This function can't be called in early-execution mode.
This function can't be called in read-only mode.
This function can't be called in early-execution mode.
This function can't be called in read-only mode.
This function can't be called in early-execution mode.
This function can't be called in read-only mode.
This function can't be called in early-execution mode.
This function can't be called in read-only mode.
This function can't be called in early-execution mode.
This function can't be called in read-only mode.
This function can't be called in early-execution mode.
This function can't be called in read-only mode.
This function can't be called in early-execution mode.
This function can't be called in read-only mode.
This function can't be called in early-execution mode.
This function can't be called in read-only mode.
This function can't be called in early-execution mode.
This function can't be called in read-only mode.
This function can't be called in early-execution mode.
Optionalstates: Record<string, string | number | boolean>This function can't be called in read-only mode.
This function can't be called in early-execution mode.
OptionalblockIdentifiers: string[]This function can't be called in read-only mode.
This function can't be called in early-execution mode.
OptionalblockIdentifiers: string[]This function can't be called in read-only mode.
This function can't be called in early-execution mode.
This function can't be called in read-only mode.
This function can throw errors.
minecraftcommon.ArgumentOutOfBoundsError
minecraftcommon.UnsupportedFunctionalityError
This function can't be called in early-execution mode.
Optionalvalue: string | number | boolean | Vector3This function can't be called in read-only mode.
This function can throw errors.
minecraftcommon.ArgumentOutOfBoundsError
minecraftcommon.UnsupportedFunctionalityError
This function can't be called in early-execution mode.
OptionalloreList: (string | RawMessage)[]This function can't be called in read-only mode.
This function can't be called in early-execution mode.
Remarks
Write Privilege
This function can't be called in read-only mode.
Throws
This function can throw errors.