Class BellBlockEntity
java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.level.block.entity.BlockEntity
net.minecraft.world.level.block.entity.BellBlockEntity
- All Implemented Interfaces:
IAttachmentHolder
,IBlockEntityExtension
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static interface
Nested classes/interfaces inherited from class net.minecraft.world.level.block.entity.BlockEntity
BlockEntity.ComponentHelper, BlockEntity.DataComponentInput
Nested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
AttachmentHolder.AsField
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
private static final int
private static final int
private static final int
private long
private static final int
private static final int
private List
<LivingEntity> private boolean
private int
A tick counter before raiders are revealed.private static final int
boolean
int
How many ticks the bell has been ringing.private static final int
Fields inherited from class net.minecraft.world.level.block.entity.BlockEntity
level, remove, worldPosition
Fields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
ATTACHMENTS_NBT_KEY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static boolean
areRaidersNearby
(BlockPos pos, List<LivingEntity> raiders) static void
clientTick
(Level level, BlockPos pos, BlockState state, BellBlockEntity blockEntity) private static void
glow
(LivingEntity entity) private static boolean
isRaiderWithinRange
(BlockPos pos, LivingEntity raider) private static void
makeRaidersGlow
(Level level, BlockPos pos, List<LivingEntity> raiders) void
static void
serverTick
(Level level, BlockPos pos, BlockState state, BellBlockEntity blockEntity) private static void
showBellParticles
(Level level, BlockPos pos, List<LivingEntity> raiders) private static void
tick
(Level level, BlockPos pos, BlockState state, BellBlockEntity blockEntity, BellBlockEntity.ResonationEndAction resonationEndAction) boolean
triggerEvent
(int id, int type) private void
Methods inherited from class net.minecraft.world.level.block.entity.BlockEntity
addEntityType, applyComponents, applyComponentsFromItemStack, applyImplicitComponents, clearRemoved, collectComponents, collectImplicitComponents, components, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPersistentData, getPosFromTag, getType, getUpdatePacket, getUpdateTag, hasLevel, isRemoved, isValidBlockState, loadAdditional, loadCustomOnly, loadStatic, loadWithComponents, onlyOpCanSetNbt, parseCustomNameSafe, removeComponentsFromTag, removeData, saveAdditional, saveCustomAndMetadata, saveCustomOnly, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setChanged, setComponents, setData, setLevel, setRemoved
Methods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
deserializeAttachments, getData, getExistingDataOrNull, hasAttachments, hasData, serializeAttachments
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder
getData, getExistingData, getExistingData, getExistingDataOrNull, hasData, removeData, setData
Methods inherited from interface net.neoforged.neoforge.common.extensions.IBlockEntityExtension
getModelData, handleUpdateTag, hasCustomOutlineRendering, invalidateCapabilities, onChunkUnloaded, onDataPacket, onLoad, requestModelDataUpdate
-
Field Details
-
DURATION
private static final int DURATION- See Also:
-
GLOW_DURATION
private static final int GLOW_DURATION- See Also:
-
MIN_TICKS_BETWEEN_SEARCHES
private static final int MIN_TICKS_BETWEEN_SEARCHES- See Also:
-
MAX_RESONATION_TICKS
private static final int MAX_RESONATION_TICKS- See Also:
-
TICKS_BEFORE_RESONATION
private static final int TICKS_BEFORE_RESONATION- See Also:
-
SEARCH_RADIUS
private static final int SEARCH_RADIUS- See Also:
-
HEAR_BELL_RADIUS
private static final int HEAR_BELL_RADIUS- See Also:
-
HIGHLIGHT_RAIDERS_RADIUS
private static final int HIGHLIGHT_RAIDERS_RADIUS- See Also:
-
lastRingTimestamp
private long lastRingTimestamp -
ticks
public int ticksHow many ticks the bell has been ringing. -
shaking
public boolean shaking -
clickDirection
-
nearbyEntities
-
resonating
private boolean resonating -
resonationTicks
private int resonationTicksA tick counter before raiders are revealed. AtTICKS_BEFORE_RESONATION
ticks, the resonation sound is played, and atMAX_RESONATION_TICKS
, nearby raiders are revealed.
-
-
Constructor Details
-
BellBlockEntity
-
-
Method Details
-
triggerEvent
public boolean triggerEvent(int id, int type) - Overrides:
triggerEvent
in classBlockEntity
-
tick
private static void tick(Level level, BlockPos pos, BlockState state, BellBlockEntity blockEntity, BellBlockEntity.ResonationEndAction resonationEndAction) -
clientTick
public static void clientTick(Level level, BlockPos pos, BlockState state, BellBlockEntity blockEntity) -
serverTick
public static void serverTick(Level level, BlockPos pos, BlockState state, BellBlockEntity blockEntity) -
onHit
-
updateEntities
private void updateEntities() -
areRaidersNearby
-
makeRaidersGlow
-
showBellParticles
-
isRaiderWithinRange
-
glow
-