Class TrialSpawnerBlockEntity
- All Implemented Interfaces:
Spawner,TrialSpawnerLogic.TrialSpawner
- Mappings:
Namespace Name named net/minecraft/block/entity/TrialSpawnerBlockEntityintermediary net/minecraft/class_8961official dsc
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.block.entity.BlockEntity
BlockEntity.ComponentsAccess -
Field Summary
FieldsFields inherited from class net.minecraft.block.entity.BlockEntity
pos, removed, world -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns whether the block item should require the player to have operator permissions to copy the block entity data on placement.protected voidreadNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup registryLookup) Reads data fromnbt.voidsetEntityType(EntityType<?> type, Random random) voidsetSpawnerState(World world, TrialSpawnerState spawnerState) toInitialChunkDataNbt(RegistryWrapper.WrapperLookup registryLookup) 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.voidprotected voidwriteNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup registryLookup) 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, onSyncedBlockEvent, populateCrashReport, posFromNbt, read, readComponentlessNbt, readComponents, readComponents, readComponents, removeFromCopiedStackNbt, setCachedState, setComponents, setStackNbt, setWorld, tryParseCustomName, writeIdToNbt
-
Field Details
-
LOGGER
- Mappings:
Namespace Name Mixin selector named LOGGERLnet/minecraft/block/entity/TrialSpawnerBlockEntity;LOGGER:Lorg/slf4j/Logger;intermediary field_47354Lnet/minecraft/class_8961;field_47354:Lorg/slf4j/Logger;official aLdsc;a:Lorg/slf4j/Logger;
-
spawner
- Mappings:
Namespace Name Mixin selector named spawnerLnet/minecraft/block/entity/TrialSpawnerBlockEntity;spawner:Lnet/minecraft/block/spawner/TrialSpawnerLogic;intermediary field_47355Lnet/minecraft/class_8961;field_47355:Lnet/minecraft/class_8963;official bLdsc;b:Ldsf;
-
-
Constructor Details
-
TrialSpawnerBlockEntity
- Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/block/entity/TrialSpawnerBlockEntity;<init>(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Vintermediary <init>Lnet/minecraft/class_8961;<init>(Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)Vofficial <init>Ldsc;<init>(Ljd;Ldtc;)V
-
-
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.
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:
readNbtin classBlockEntity- See Also:
- Mappings:
Namespace Name Mixin selector named readNbtLnet/minecraft/block/entity/BlockEntity;readNbt(Lnet/minecraft/nbt/NbtCompound;Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)Vintermediary method_11014Lnet/minecraft/class_2586;method_11014(Lnet/minecraft/class_2487;Lnet/minecraft/class_7225$class_7874;)Vofficial aLdqh;a(Lub;Ljo$a;)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:
writeNbtin classBlockEntity- See Also:
- Mappings:
Namespace Name Mixin selector named writeNbtLnet/minecraft/block/entity/BlockEntity;writeNbt(Lnet/minecraft/nbt/NbtCompound;Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)Vintermediary method_11007Lnet/minecraft/class_2586;method_11007(Lnet/minecraft/class_2487;Lnet/minecraft/class_7225$class_7874;)Vofficial bLdqh;b(Lub;Ljo$a;)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 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:
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/TrialSpawnerBlockEntity;toUpdatePacket()Lnet/minecraft/network/packet/s2c/play/BlockEntityUpdateS2CPacket;intermediary method_55149Lnet/minecraft/class_8961;method_55149()Lnet/minecraft/class_2622;official bLdsc;b()Lacb;
-
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 aLdqh;a(Ljo$a;)Lub;
-
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:
copyItemDataRequiresOperatorin 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 named copyItemDataRequiresOperatorLnet/minecraft/block/entity/BlockEntity;copyItemDataRequiresOperator()Zintermediary method_11011Lnet/minecraft/class_2586;method_11011()Zofficial qLdqh;q()Z
-
setEntityType
- Specified by:
setEntityTypein interfaceSpawner- Mappings:
Namespace Name Mixin selector named setEntityTypeLnet/minecraft/block/entity/Spawner;setEntityType(Lnet/minecraft/entity/EntityType;Lnet/minecraft/util/math/random/Random;)Vintermediary method_46408Lnet/minecraft/class_8959;method_46408(Lnet/minecraft/class_1299;Lnet/minecraft/class_5819;)Vofficial aLddp;a(Lbsx;Layw;)V
-
getSpawner
- Mappings:
Namespace Name Mixin selector named getSpawnerLnet/minecraft/block/entity/TrialSpawnerBlockEntity;getSpawner()Lnet/minecraft/block/spawner/TrialSpawnerLogic;intermediary method_55150Lnet/minecraft/class_8961;method_55150()Lnet/minecraft/class_8963;official cLdsc;c()Ldsf;
-
getSpawnerState
- Specified by:
getSpawnerStatein interfaceTrialSpawnerLogic.TrialSpawner- Mappings:
Namespace Name Mixin selector named getSpawnerStateLnet/minecraft/block/spawner/TrialSpawnerLogic$TrialSpawner;getSpawnerState()Lnet/minecraft/block/enums/TrialSpawnerState;intermediary method_55151Lnet/minecraft/class_8963$class_8964;method_55151()Lnet/minecraft/class_8967;official dLdsf$b;d()Ldsi;
-
setSpawnerState
- Specified by:
setSpawnerStatein interfaceTrialSpawnerLogic.TrialSpawner- Mappings:
Namespace Name Mixin selector named setSpawnerStateLnet/minecraft/block/spawner/TrialSpawnerLogic$TrialSpawner;setSpawnerState(Lnet/minecraft/world/World;Lnet/minecraft/block/enums/TrialSpawnerState;)Vintermediary method_55146Lnet/minecraft/class_8963$class_8964;method_55146(Lnet/minecraft/class_1937;Lnet/minecraft/class_8967;)Vofficial aLdsf$b;a(Ldcw;Ldsi;)V
-
updateListeners
public void updateListeners()- Specified by:
updateListenersin interfaceTrialSpawnerLogic.TrialSpawner- Mappings:
Namespace Name Mixin selector named updateListenersLnet/minecraft/block/spawner/TrialSpawnerLogic$TrialSpawner;updateListeners()Vintermediary method_55152Lnet/minecraft/class_8963$class_8964;method_55152()Vofficial fLdsf$b;f()V
-