Class class_8961
- All Implemented Interfaces:
class_8959
,class_8963.class_8964
- Mappings:
Namespace Name official dhw
intermediary net/minecraft/class_8961
named net/minecraft/class_8961
-
Field Summary
FieldsFields inherited from class net.minecraft.block.entity.BlockEntity
pos, removed, world
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns whether the block item should require the player to have operator permissions to copy the block entity data on placement.void
method_55146
(World world, class_8967 class_8967) void
void
readNbt
(NbtCompound nbt) Reads data fromnbt
.void
setEntityType
(EntityType<?> entityType, Random random) Returns the serialized state of this block entity that is observable by clients.Returns the packet to send to nearby players when the block entity's observable state changes, ornull
to not send the packet.protected void
writeNbt
(NbtCompound nbt) Writes data tonbt
.Methods inherited from class net.minecraft.block.entity.BlockEntity
cancelRemoval, createFromNbt, createNbt, createNbtWithId, createNbtWithIdentifyingData, getCachedState, getPos, getType, getWorld, hasWorld, isRemoved, markDirty, markDirty, markRemoved, onSyncedBlockEvent, populateCrashReport, posFromNbt, setCachedState, setStackNbt, setWorld, writeIdToNbt
-
Field Details
-
field_47354
- Mappings:
Namespace Name Mixin selector official a
Ldhw;a:Lorg/slf4j/Logger;
intermediary field_47354
Lnet/minecraft/class_8961;field_47354:Lorg/slf4j/Logger;
named field_47354
Lnet/minecraft/class_8961;field_47354:Lorg/slf4j/Logger;
-
field_47355
- Mappings:
Namespace Name Mixin selector official b
Ldhw;b:Ldhz;
intermediary field_47355
Lnet/minecraft/class_8961;field_47355:Lnet/minecraft/class_8963;
named field_47355
Lnet/minecraft/class_8961;field_47355:Lnet/minecraft/class_8963;
-
-
Constructor Details
-
class_8961
-
-
Method Details
-
readNbt
Reads data fromnbt
. Subclasses should override this if they store a persistent data.NBT is a storage format; therefore, a data from NBT is loaded to a block entity instance's fields, which are used for other operations instead of the NBT. The data is written back to NBT when saving the block entity.
nbt
might not have all expected keys, or might have a key whose value does not meet the requirement (such as the type or the range). This method should fall back to a reasonable default value instead of throwing an exception.- Overrides:
readNbt
in classBlockEntity
- See Also:
- Mappings:
Namespace Name Mixin selector official a
Ldgd;a(Lsj;)V
intermediary method_11014
Lnet/minecraft/class_2586;method_11014(Lnet/minecraft/class_2487;)V
named readNbt
Lnet/minecraft/block/entity/BlockEntity;readNbt(Lnet/minecraft/nbt/NbtCompound;)V
-
writeNbt
Writes data tonbt
. Subclasses should override this if they store a persistent data.NBT is a storage format; therefore, a data from NBT is loaded to a block entity instance's fields, which are used for other operations instead of the NBT. The data is written back to NBT when saving the block entity.
- Overrides:
writeNbt
in classBlockEntity
- See Also:
- Mappings:
Namespace Name Mixin selector official b
Ldgd;b(Lsj;)V
intermediary method_11007
Lnet/minecraft/class_2586;method_11007(Lnet/minecraft/class_2487;)V
named writeNbt
Lnet/minecraft/block/entity/BlockEntity;writeNbt(Lnet/minecraft/nbt/NbtCompound;)V
-
toUpdatePacket
Description copied from class:BlockEntity
Returns the packet to send to nearby players when the block entity's observable state changes, ornull
to not send the packet.If the data returned by
initial chunk data
is suitable for updates, the following shortcut can be used to create an update packet:BlockEntityUpdateS2CPacket.create(this)
. The NBT will be passed toBlockEntity.readNbt(net.minecraft.nbt.NbtCompound)
on the client."Observable state" is a state that clients can observe without specific interaction. For example,
CampfireBlockEntity
's cooked items are observable states, but chests' inventories are not observable states, since the player must first open that chest before they can see the contents.To sync block entity data using this method, use
serverWorld.getChunkManager().markForUpdate(this.getPos());
.- Overrides:
toUpdatePacket
in classBlockEntity
- Returns:
- the packet to send to nearby players when the block entity's observable
state changes, or
null
to not send the packet - See Also:
- Mappings:
Namespace Name Mixin selector official c
Ldhw;c()Lyv;
intermediary method_55149
Lnet/minecraft/class_8961;method_55149()Lnet/minecraft/class_2622;
named toUpdatePacket
Lnet/minecraft/class_8961;toUpdatePacket()Lnet/minecraft/network/packet/s2c/play/BlockEntityUpdateS2CPacket;
-
toInitialChunkDataNbt
Returns the serialized state of this block entity that is observable by clients.This is sent alongside the initial chunk data, as well as when the block entity implements
BlockEntity.toUpdatePacket()
and decides to use the defaultBlockEntityUpdateS2CPacket
."Observable state" is a state that clients can observe without specific interaction. For example,
CampfireBlockEntity
's cooked items are observable states, but chests' inventories are not observable states, since the player must first open that chest before they can see the contents.To send all NBT data of this block entity saved to disk, return
BlockEntity.createNbt()
.- Overrides:
toInitialChunkDataNbt
in classBlockEntity
- Returns:
- the serialized state of this block entity that is observable by clients
- See Also:
- Mappings:
Namespace Name Mixin selector official ax_
Ldgd;ax_()Lsj;
intermediary method_16887
Lnet/minecraft/class_2586;method_16887()Lnet/minecraft/class_2487;
named toInitialChunkDataNbt
Lnet/minecraft/block/entity/BlockEntity;toInitialChunkDataNbt()Lnet/minecraft/nbt/NbtCompound;
-
copyItemDataRequiresOperator
public boolean copyItemDataRequiresOperator()Returns whether the block item should require the player to have operator permissions to copy the block entity data on placement.Block entities that can execute commands should override this to return
true
.- Overrides:
copyItemDataRequiresOperator
in classBlockEntity
- Returns:
- whether the block item should require the player to have operator permissions to copy the block entity data on placement
- See Also:
- Mappings:
Namespace Name Mixin selector official u
Ldgd;u()Z
intermediary method_11011
Lnet/minecraft/class_2586;method_11011()Z
named copyItemDataRequiresOperator
Lnet/minecraft/block/entity/BlockEntity;copyItemDataRequiresOperator()Z
-
setEntityType
- Specified by:
setEntityType
in interfaceclass_8959
- Mappings:
Namespace Name Mixin selector official a
Lctq;a(Lblj;Lauf;)V
intermediary method_46408
Lnet/minecraft/class_8959;method_46408(Lnet/minecraft/class_1299;Lnet/minecraft/class_5819;)V
named setEntityType
Lnet/minecraft/class_8959;setEntityType(Lnet/minecraft/entity/EntityType;Lnet/minecraft/util/math/random/Random;)V
-
method_55150
- Mappings:
Namespace Name Mixin selector official d
Ldhw;d()Ldhz;
intermediary method_55150
Lnet/minecraft/class_8961;method_55150()Lnet/minecraft/class_8963;
named method_55150
Lnet/minecraft/class_8961;method_55150()Lnet/minecraft/class_8963;
-
method_55151
- Specified by:
method_55151
in interfaceclass_8963.class_8964
- Mappings:
Namespace Name Mixin selector official f
Ldhz$a;f()Ldic;
intermediary method_55151
Lnet/minecraft/class_8963$class_8964;method_55151()Lnet/minecraft/class_8967;
named method_55151
Lnet/minecraft/class_8963$class_8964;method_55151()Lnet/minecraft/class_8967;
-
method_55146
- Specified by:
method_55146
in interfaceclass_8963.class_8964
- Mappings:
Namespace Name Mixin selector official a
Ldhz$a;a(Lcsy;Ldic;)V
intermediary method_55146
Lnet/minecraft/class_8963$class_8964;method_55146(Lnet/minecraft/class_1937;Lnet/minecraft/class_8967;)V
named method_55146
Lnet/minecraft/class_8963$class_8964;method_55146(Lnet/minecraft/world/World;Lnet/minecraft/class_8967;)V
-
method_55152
public void method_55152()- Specified by:
method_55152
in interfaceclass_8963.class_8964
- Mappings:
Namespace Name Mixin selector official g
Ldhz$a;g()V
intermediary method_55152
Lnet/minecraft/class_8963$class_8964;method_55152()V
named method_55152
Lnet/minecraft/class_8963$class_8964;method_55152()V
-