Class TestBlockEntity
- Mappings:
Namespace Name named net/minecraft/block/entity/TestBlockEntity
intermediary net/minecraft/class_10637
official eai
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
private static final boolean
private static final Logger
private String
private TestBlockMode
private boolean
private boolean
Fields inherited from class net.minecraft.block.entity.BlockEntity
pos, removed, world
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate Block
getBlock()
getMode()
boolean
boolean
void
void
readNbt
(NbtCompound nbt, RegistryWrapper.WrapperLookup registries) Reads data fromnbt
.void
reset()
void
setMessage
(String message) void
setMode
(TestBlockMode mode) void
setPowered
(boolean powered) toInitialChunkDataNbt
(RegistryWrapper.WrapperLookup registries) 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.void
trigger()
private void
update()
void
writeNbt
(NbtCompound nbt, RegistryWrapper.WrapperLookup registries) Writes data tonbt
.Methods inherited from class net.minecraft.block.entity.BlockEntity
addComponents, cancelRemoval, createComponentlessNbt, createComponentlessNbtWithIdentifyingData, createComponentMap, createFromNbt, createNbt, createNbtWithId, createNbtWithIdentifyingData, getCachedState, getComponents, getPos, getType, getWorld, hasWorld, isRemoved, markDirty, markDirty, markRemoved, onBlockReplaced, onSyncedBlockEvent, populateCrashReport, posFromNbt, read, readComponentlessNbt, readComponents, readComponents, readComponents, removeFromCopiedStackNbt, setCachedState, setComponents, setWorld, supports, tryParseCustomName, writeIdToNbt
-
Field Details
-
LOGGER
- Mappings:
Namespace Name Mixin selector named LOGGER
Lnet/minecraft/block/entity/TestBlockEntity;LOGGER:Lorg/slf4j/Logger;
intermediary field_55998
Lnet/minecraft/class_10637;field_55998:Lorg/slf4j/Logger;
official a
Leai;a:Lorg/slf4j/Logger;
-
DEFAULT_MESSAGE
- See Also:
- Mappings:
Namespace Name Mixin selector named DEFAULT_MESSAGE
Lnet/minecraft/block/entity/TestBlockEntity;DEFAULT_MESSAGE:Ljava/lang/String;
intermediary field_57800
Lnet/minecraft/class_10637;field_57800:Ljava/lang/String;
official b
Leai;b:Ljava/lang/String;
-
DEFAULT_POWERED
private static final boolean DEFAULT_POWERED- See Also:
- Mappings:
Namespace Name Mixin selector named DEFAULT_POWERED
Lnet/minecraft/block/entity/TestBlockEntity;DEFAULT_POWERED:Z
intermediary field_57801
Lnet/minecraft/class_10637;field_57801:Z
official c
Leai;c:Z
-
mode
- Mappings:
Namespace Name Mixin selector named mode
Lnet/minecraft/block/entity/TestBlockEntity;mode:Lnet/minecraft/block/enums/TestBlockMode;
intermediary field_55999
Lnet/minecraft/class_10637;field_55999:Lnet/minecraft/class_10641;
official d
Leai;d:Ledb;
-
message
- Mappings:
Namespace Name Mixin selector named message
Lnet/minecraft/block/entity/TestBlockEntity;message:Ljava/lang/String;
intermediary field_56000
Lnet/minecraft/class_10637;field_56000:Ljava/lang/String;
official e
Leai;e:Ljava/lang/String;
-
powered
private boolean powered- Mappings:
Namespace Name Mixin selector named powered
Lnet/minecraft/block/entity/TestBlockEntity;powered:Z
intermediary field_56001
Lnet/minecraft/class_10637;field_56001:Z
official f
Leai;f:Z
-
triggered
private boolean triggered- Mappings:
Namespace Name Mixin selector named triggered
Lnet/minecraft/block/entity/TestBlockEntity;triggered:Z
intermediary field_56002
Lnet/minecraft/class_10637;field_56002:Z
official g
Leai;g:Z
-
-
Constructor Details
-
TestBlockEntity
- Mappings:
Namespace Name Mixin selector named <init>
Lnet/minecraft/block/entity/TestBlockEntity;<init>(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
intermediary <init>
Lnet/minecraft/class_10637;<init>(Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
official <init>
Leai;<init>(Liw;Lebq;)V
-
-
Method Details
-
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 named writeNbt
Lnet/minecraft/block/entity/BlockEntity;writeNbt(Lnet/minecraft/nbt/NbtCompound;Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)V
intermediary method_11007
Lnet/minecraft/class_2586;method_11007(Lnet/minecraft/class_2487;Lnet/minecraft/class_7225$class_7874;)V
official b
Ldyo;b(Lua;Lji$a;)V
-
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 named readNbt
Lnet/minecraft/block/entity/BlockEntity;readNbt(Lnet/minecraft/nbt/NbtCompound;Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)V
intermediary method_11014
Lnet/minecraft/class_2586;method_11014(Lnet/minecraft/class_2487;Lnet/minecraft/class_7225$class_7874;)V
official a
Ldyo;a(Lua;Lji$a;)V
-
update
private void update()- Mappings:
Namespace Name Mixin selector named update
Lnet/minecraft/block/entity/TestBlockEntity;update()V
intermediary method_66729
Lnet/minecraft/class_10637;method_66729()V
official u
Leai;u()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, net.minecraft.registry.RegistryWrapper.WrapperLookup)
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 named toUpdatePacket
Lnet/minecraft/block/entity/TestBlockEntity;toUpdatePacket()Lnet/minecraft/network/packet/s2c/play/BlockEntityUpdateS2CPacket;
intermediary method_66718
Lnet/minecraft/class_10637;method_66718()Lnet/minecraft/class_2622;
official a
Leai;a()Lacl;
-
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
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(net.minecraft.registry.RegistryWrapper.WrapperLookup)
.- Overrides:
toInitialChunkDataNbt
in classBlockEntity
- Returns:
- the serialized state of this block entity that is observable by clients
- See Also:
- Mappings:
Namespace Name Mixin selector named toInitialChunkDataNbt
Lnet/minecraft/block/entity/BlockEntity;toInitialChunkDataNbt(Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)Lnet/minecraft/nbt/NbtCompound;
intermediary method_16887
Lnet/minecraft/class_2586;method_16887(Lnet/minecraft/class_7225$class_7874;)Lnet/minecraft/class_2487;
official a
Ldyo;a(Lji$a;)Lua;
-
isPowered
public boolean isPowered()- Mappings:
Namespace Name Mixin selector named isPowered
Lnet/minecraft/block/entity/TestBlockEntity;isPowered()Z
intermediary method_66722
Lnet/minecraft/class_10637;method_66722()Z
official c
Leai;c()Z
-
setPowered
public void setPowered(boolean powered) - Mappings:
Namespace Name Mixin selector named setPowered
Lnet/minecraft/block/entity/TestBlockEntity;setPowered(Z)V
intermediary method_66721
Lnet/minecraft/class_10637;method_66721(Z)V
official a
Leai;a(Z)V
-
getMode
- Mappings:
Namespace Name Mixin selector named getMode
Lnet/minecraft/block/entity/TestBlockEntity;getMode()Lnet/minecraft/block/enums/TestBlockMode;
intermediary method_66723
Lnet/minecraft/class_10637;method_66723()Lnet/minecraft/class_10641;
official d
Leai;d()Ledb;
-
setMode
- Mappings:
Namespace Name Mixin selector named setMode
Lnet/minecraft/block/entity/TestBlockEntity;setMode(Lnet/minecraft/block/enums/TestBlockMode;)V
intermediary method_66719
Lnet/minecraft/class_10637;method_66719(Lnet/minecraft/class_10641;)V
official a
Leai;a(Ledb;)V
-
getBlock
- Mappings:
Namespace Name Mixin selector named getBlock
Lnet/minecraft/block/entity/TestBlockEntity;getBlock()Lnet/minecraft/block/Block;
intermediary method_66730
Lnet/minecraft/class_10637;method_66730()Lnet/minecraft/class_2248;
official v
Leai;v()Ldno;
-
reset
public void reset()- Mappings:
Namespace Name Mixin selector named reset
Lnet/minecraft/block/entity/TestBlockEntity;reset()V
intermediary method_66724
Lnet/minecraft/class_10637;method_66724()V
official f
Leai;f()V
-
trigger
public void trigger()- Mappings:
Namespace Name Mixin selector named trigger
Lnet/minecraft/block/entity/TestBlockEntity;trigger()V
intermediary method_66725
Lnet/minecraft/class_10637;method_66725()V
official j
Leai;j()V
-
logMessage
public void logMessage()- Mappings:
Namespace Name Mixin selector named logMessage
Lnet/minecraft/block/entity/TestBlockEntity;logMessage()V
intermediary method_66726
Lnet/minecraft/class_10637;method_66726()V
official k
Leai;k()V
-
hasTriggered
public boolean hasTriggered()- Mappings:
Namespace Name Mixin selector named hasTriggered
Lnet/minecraft/block/entity/TestBlockEntity;hasTriggered()Z
intermediary method_66727
Lnet/minecraft/class_10637;method_66727()Z
official s
Leai;s()Z
-
getMessage
- Mappings:
Namespace Name Mixin selector named getMessage
Lnet/minecraft/block/entity/TestBlockEntity;getMessage()Ljava/lang/String;
intermediary method_66728
Lnet/minecraft/class_10637;method_66728()Ljava/lang/String;
official t
Leai;t()Ljava/lang/String;
-
setMessage
- Mappings:
Namespace Name Mixin selector named setMessage
Lnet/minecraft/block/entity/TestBlockEntity;setMessage(Ljava/lang/String;)V
intermediary method_66720
Lnet/minecraft/class_10637;method_66720(Ljava/lang/String;)V
official a
Leai;a(Ljava/lang/String;)V
-