GroundItem
A stack of items lying in the world, which all players see as a stack the game lets them pick up. When a player picks it up, the units enter their inventory and the stack goes for everyone. Items dropped from an inventory and arrows or bolts that land also become ground items.
groundItem.spawn()
GroundItem.spawn(item, position = {}, orientation = {}, amount = 1, dimension = GLOBAL_WORLD, properties = {},)Lays a stack in the world. A worn class with no ground model, where Items.model gives '', such as DLC badges that only pin to a cap, throws a TypeError, since the game would draw nothing.
groundItem.all()
GroundItem.all()All ground items.
groundItem.getById()
GroundItem.getById(id)The stack with this network id, or null.
groundItem.destroyAll()
GroundItem.destroyAll(dimension)Removes all stacks, or those in one dimension, and returns how many.
groundItem.position
positionIts location.
groundItem.rotation
rotationIts rotation.
groundItem.resting
restingWhether the stack has stopped. A stack starts where it was spawned or dropped, and the game's physics lets it fall and roll. The first game in view to see it stop reports the spot, and from then on it lies there on all clients, with `position` and `rotation` at that spot, and groundItemResting fires. Until then it is false, including while no player is near enough. A landed arrow or bolt is at rest from the start.
groundItem.leftBy
leftByThe player who dropped it, or null.
groundItem.visibleTo
visibleToThe one player who sees it, or null if everyone does.
groundItem.showOnlyTo()
showOnlyTo(player)Shows the stack to one player, whose game alone lays it and who alone can take it. null shows it to everyone again. Throws a TypeError for anything except a connected Player or null. If that player leaves, nobody sees it until it is shown to someone else.
groundItem.destroy()
destroy()Removes the stack, firing groundItemDestroy.
groundItem.id
id: numberThe network id.
groundItem.itemClass
itemClass: stringThe item class, as 32 hex digits.
groundItem.amount
amount: numberThe units in the stack.
groundItem.quality
quality: numberThe units' quality.
groundItem.health
health: numberThe units' condition, as health.
groundItem.carryable
carryable: booleanWhether it is carried in the arms rather than picked up into the inventory.
groundItem.dimension
dimension: numberIts dimension.
groundItem.name
name: stringThe name from GroundItem.spawn's properties, for finding it again, or ''.