Class TestBlockEntity
- All Implemented Interfaces:
DebugTrackable
- Mappings:
Namespace Name named net/minecraft/block/entity/TestBlockEntityintermediary net/minecraft/class_10637official eid
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.world.debug.DebugTrackable
DebugTrackable.DebugDataSupplier<T>, DebugTrackable.Tracker -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate static final booleanprivate static final Loggerprivate Stringprivate TestBlockModeprivate booleanprivate booleanFields inherited from class net.minecraft.block.entity.BlockEntity
pos, removed, world -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate BlockgetBlock()getMode()booleanbooleanvoidprotected voidReads data fromnbt.voidreset()voidsetMessage(String message) voidsetMode(TestBlockMode mode) voidsetPowered(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, ornullto not send the packet.voidtrigger()private voidupdate()protected voidWrites data tonbt.Methods inherited from class net.minecraft.block.entity.BlockEntity
addComponents, cancelRemoval, createComponentlessNbt, createComponentMap, createFromNbt, createNbt, createNbtWithIdentifyingData, getCachedState, getComponents, getNameForReport, getPos, getReporterContext, getType, getWorld, hasWorld, isRemoved, markDirty, markDirty, markRemoved, onBlockReplaced, onSyncedBlockEvent, populateCrashReport, posFromNbt, read, readComponentlessData, readComponents, readComponents, readComponents, registerTracking, removeFromCopiedStackData, setCachedState, setComponents, setWorld, supports, tryParseCustomName, writeComponentlessData, writeDataWithId, writeDataWithoutId, writeFullData, writeId
-
Field Details
-
LOGGER
- Mappings:
Namespace Name Mixin selector named LOGGERLnet/minecraft/block/entity/TestBlockEntity;LOGGER:Lorg/slf4j/Logger;intermediary field_55998Lnet/minecraft/class_10637;field_55998:Lorg/slf4j/Logger;official aLeid;a:Lorg/slf4j/Logger;
-
DEFAULT_MESSAGE
- See Also:
- Mappings:
Namespace Name Mixin selector named DEFAULT_MESSAGELnet/minecraft/block/entity/TestBlockEntity;DEFAULT_MESSAGE:Ljava/lang/String;intermediary field_57800Lnet/minecraft/class_10637;field_57800:Ljava/lang/String;official bLeid;b:Ljava/lang/String;
-
DEFAULT_POWERED
private static final boolean DEFAULT_POWERED- See Also:
- Mappings:
Namespace Name Mixin selector named DEFAULT_POWEREDLnet/minecraft/block/entity/TestBlockEntity;DEFAULT_POWERED:Zintermediary field_57801Lnet/minecraft/class_10637;field_57801:Zofficial cLeid;c:Z
-
mode
- Mappings:
Namespace Name Mixin selector named modeLnet/minecraft/block/entity/TestBlockEntity;mode:Lnet/minecraft/block/enums/TestBlockMode;intermediary field_55999Lnet/minecraft/class_10637;field_55999:Lnet/minecraft/class_10641;official dLeid;d:Leky;
-
message
- Mappings:
Namespace Name Mixin selector named messageLnet/minecraft/block/entity/TestBlockEntity;message:Ljava/lang/String;intermediary field_56000Lnet/minecraft/class_10637;field_56000:Ljava/lang/String;official eLeid;e:Ljava/lang/String;
-
powered
private boolean powered- Mappings:
Namespace Name Mixin selector named poweredLnet/minecraft/block/entity/TestBlockEntity;powered:Zintermediary field_56001Lnet/minecraft/class_10637;field_56001:Zofficial fLeid;f:Z
-
triggered
private boolean triggered- Mappings:
Namespace Name Mixin selector named triggeredLnet/minecraft/block/entity/TestBlockEntity;triggered:Zintermediary field_56002Lnet/minecraft/class_10637;field_56002:Zofficial gLeid;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;)Vintermediary <init>Lnet/minecraft/class_10637;<init>(Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)Vofficial <init>Leid;<init>(Lja;Lejm;)V
-
-
Method Details
-
writeData
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:
writeDatain classBlockEntity- See Also:
- Mappings:
Namespace Name Mixin selector named writeDataLnet/minecraft/block/entity/BlockEntity;writeData(Lnet/minecraft/storage/WriteView;)Vintermediary method_11007Lnet/minecraft/class_2586;method_11007(Lnet/minecraft/class_11372;)Vofficial aLegg;a(Lfir;)V
-
readData
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.
nbtmight 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:
readDatain classBlockEntity- See Also:
- Mappings:
Namespace Name Mixin selector named readDataLnet/minecraft/block/entity/BlockEntity;readData(Lnet/minecraft/storage/ReadView;)Vintermediary method_11014Lnet/minecraft/class_2586;method_11014(Lnet/minecraft/class_11368;)Vofficial aLegg;a(Lfip;)V
-
update
private void update()- Mappings:
Namespace Name Mixin selector named updateLnet/minecraft/block/entity/TestBlockEntity;update()Vintermediary method_66729Lnet/minecraft/class_10637;method_66729()Vofficial wLeid;w()V
-
toUpdatePacket
Description copied from class:BlockEntityReturns the packet to send to nearby players when the block entity's observable state changes, ornullto not send the packet.If the data returned by
initial chunk datais suitable for updates, the following shortcut can be used to create an update packet:BlockEntityUpdateS2CPacket.create(this). The NBT will be passed toon the client.invalid reference
#readNbt"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:
toUpdatePacketin classBlockEntity- Returns:
- the packet to send to nearby players when the block entity's observable
state changes, or
nullto not send the packet - See Also:
- Mappings:
Namespace Name Mixin selector named toUpdatePacketLnet/minecraft/block/entity/TestBlockEntity;toUpdatePacket()Lnet/minecraft/network/packet/s2c/play/BlockEntityUpdateS2CPacket;intermediary method_66718Lnet/minecraft/class_10637;method_66718()Lnet/minecraft/class_2622;official aLeid;a()Lacx;
-
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:
toInitialChunkDataNbtin classBlockEntity- Returns:
- the serialized state of this block entity that is observable by clients
- See Also:
- Mappings:
Namespace Name Mixin selector named toInitialChunkDataNbtLnet/minecraft/block/entity/BlockEntity;toInitialChunkDataNbt(Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)Lnet/minecraft/nbt/NbtCompound;intermediary method_16887Lnet/minecraft/class_2586;method_16887(Lnet/minecraft/class_7225$class_7874;)Lnet/minecraft/class_2487;official aLegg;a(Ljm$a;)Lup;
-
isPowered
public boolean isPowered()- Mappings:
Namespace Name Mixin selector named isPoweredLnet/minecraft/block/entity/TestBlockEntity;isPowered()Zintermediary method_66722Lnet/minecraft/class_10637;method_66722()Zofficial cLeid;c()Z
-
setPowered
public void setPowered(boolean powered) - Mappings:
Namespace Name Mixin selector named setPoweredLnet/minecraft/block/entity/TestBlockEntity;setPowered(Z)Vintermediary method_66721Lnet/minecraft/class_10637;method_66721(Z)Vofficial aLeid;a(Z)V
-
getMode
- Mappings:
Namespace Name Mixin selector named getModeLnet/minecraft/block/entity/TestBlockEntity;getMode()Lnet/minecraft/block/enums/TestBlockMode;intermediary method_66723Lnet/minecraft/class_10637;method_66723()Lnet/minecraft/class_10641;official dLeid;d()Leky;
-
setMode
- Mappings:
Namespace Name Mixin selector named setModeLnet/minecraft/block/entity/TestBlockEntity;setMode(Lnet/minecraft/block/enums/TestBlockMode;)Vintermediary method_66719Lnet/minecraft/class_10637;method_66719(Lnet/minecraft/class_10641;)Vofficial aLeid;a(Leky;)V
-
getBlock
- Mappings:
Namespace Name Mixin selector named getBlockLnet/minecraft/block/entity/TestBlockEntity;getBlock()Lnet/minecraft/block/Block;intermediary method_66730Lnet/minecraft/class_10637;method_66730()Lnet/minecraft/class_2248;official xLeid;x()Lduv;
-
reset
public void reset()- Mappings:
Namespace Name Mixin selector named resetLnet/minecraft/block/entity/TestBlockEntity;reset()Vintermediary method_66724Lnet/minecraft/class_10637;method_66724()Vofficial fLeid;f()V
-
trigger
public void trigger()- Mappings:
Namespace Name Mixin selector named triggerLnet/minecraft/block/entity/TestBlockEntity;trigger()Vintermediary method_66725Lnet/minecraft/class_10637;method_66725()Vofficial hLeid;h()V
-
logMessage
public void logMessage()- Mappings:
Namespace Name Mixin selector named logMessageLnet/minecraft/block/entity/TestBlockEntity;logMessage()Vintermediary method_66726Lnet/minecraft/class_10637;method_66726()Vofficial kLeid;k()V
-
hasTriggered
public boolean hasTriggered()- Mappings:
Namespace Name Mixin selector named hasTriggeredLnet/minecraft/block/entity/TestBlockEntity;hasTriggered()Zintermediary method_66727Lnet/minecraft/class_10637;method_66727()Zofficial lLeid;l()Z
-
getMessage
- Mappings:
Namespace Name Mixin selector named getMessageLnet/minecraft/block/entity/TestBlockEntity;getMessage()Ljava/lang/String;intermediary method_66728Lnet/minecraft/class_10637;method_66728()Ljava/lang/String;official mLeid;m()Ljava/lang/String;
-
setMessage
- Mappings:
Namespace Name Mixin selector named setMessageLnet/minecraft/block/entity/TestBlockEntity;setMessage(Ljava/lang/String;)Vintermediary method_66720Lnet/minecraft/class_10637;method_66720(Ljava/lang/String;)Vofficial aLeid;a(Ljava/lang/String;)V
-