public final class DeathChest extends Object
| Constructor and Description |
|---|
DeathChest(UUID identifier,
net.minecraft.server.world.ServerWorld world,
UUID playerUUID,
List<net.minecraft.entity.ItemEntity> items,
net.minecraft.entity.player.PlayerInventory inventory,
long creationTime,
net.minecraft.util.math.BlockPos pos,
boolean isDoubleChest,
boolean locked)
Constructs a
DeathChest with the specified properties. |
| Modifier and Type | Method and Description |
|---|---|
List<net.minecraft.entity.ItemEntity> |
cloneItems()
Returns a cloned mutable list containing this death chest's items.
|
boolean |
exists()
Returns whether this death chest exists in the world.
|
static DeathChest |
fromTag(net.minecraft.server.world.ServerWorld world,
net.minecraft.nbt.CompoundTag tag)
Deserializes a death chest from a
CompoundTag. |
long |
getCreationTime()
Returns this death chest's creation time.
|
UUID |
getIdentifier()
Returns this death chest's identifier.
|
net.minecraft.entity.player.PlayerInventory |
getInventory()
Returns the player inventory at the time of death.
|
List<net.minecraft.entity.ItemEntity> |
getItems()
Returns a mutable list containing this death chest's items.
|
UUID |
getPlayerUUID()
Returns this death chest's player UUID.
|
net.minecraft.util.math.BlockPos |
getPos()
Returns this death chest's position.
|
net.minecraft.server.world.ServerWorld |
getWorld()
Returns this death chest's world.
|
boolean |
isDoubleChest()
Returns whether this death chest is a double chest.
|
boolean |
isLocked()
Returns whether this death chest is locked.
|
boolean |
isProtectedFrom(net.minecraft.entity.player.PlayerEntity player)
Returns whether death chest protection prevents the specified player from opening this
death chest.
|
void |
setLocked(boolean flag)
Sets whether this death chest is locked.
|
net.minecraft.nbt.CompoundTag |
toTag(net.minecraft.nbt.CompoundTag tag)
Serializes this death chest to a
CompoundTag. |
public DeathChest(UUID identifier, net.minecraft.server.world.ServerWorld world, UUID playerUUID, List<net.minecraft.entity.ItemEntity> items, net.minecraft.entity.player.PlayerInventory inventory, long creationTime, net.minecraft.util.math.BlockPos pos, boolean isDoubleChest, boolean locked)
DeathChest with the specified properties.identifier - a UUID.world - a ServerWorld.playerUUID - a player UUID.items - the items.inventory - the player inventory at the time of death.creationTime - a creation time.pos - a position. If this is a double chest, this is the position of the west block.isDoubleChest - whether the chest is a double chest.locked - whether the chest is locked.public net.minecraft.server.world.ServerWorld getWorld()
public UUID getPlayerUUID()
public List<net.minecraft.entity.ItemEntity> getItems()
public List<net.minecraft.entity.ItemEntity> cloneItems()
public net.minecraft.entity.player.PlayerInventory getInventory()
PlayerInventory at the time of death.public long getCreationTime()
public net.minecraft.util.math.BlockPos getPos()
public boolean isDoubleChest()
true even if one half of the double chest has been destroyed.true if this death chest is a double chest, or otherwise false.public boolean isLocked()
true if this death chest is locked, or otherwise false.public void setLocked(boolean flag)
flag - true if this death chest should be locked,
or false if this death chest should be unlocked.public boolean exists()
true if this death chest exists, or otherwise false.public boolean isProtectedFrom(net.minecraft.entity.player.PlayerEntity player)
player - a player.true if this death chest is protected from the specified player,
or otherwise false.public net.minecraft.nbt.CompoundTag toTag(net.minecraft.nbt.CompoundTag tag)
CompoundTag.tag - a CompoundTag.CompoundTag.public static DeathChest fromTag(net.minecraft.server.world.ServerWorld world, net.minecraft.nbt.CompoundTag tag)
CompoundTag.world - a ServerWorld.tag - a CompoundTag.DeathChest.