Package net.minecraft.world.level.block
Class SculkSensorBlock
java.lang.Object
net.minecraft.world.level.block.state.BlockBehaviour
net.minecraft.world.level.block.Block
net.minecraft.world.level.block.BaseEntityBlock
net.minecraft.world.level.block.SculkSensorBlock
- All Implemented Interfaces:
FeatureElement
,BucketPickup
,EntityBlock
,LiquidBlockContainer
,SimpleWaterloggedBlock
,ItemLike
,IBlockExtension
,IBucketPickupExtension
- Direct Known Subclasses:
CalibratedSculkSensorBlock
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.level.block.Block
Block.BlockStatePairKey
Nested classes/interfaces inherited from class net.minecraft.world.level.block.state.BlockBehaviour
BlockBehaviour.BlockStateBase, BlockBehaviour.OffsetFunction, BlockBehaviour.OffsetType, BlockBehaviour.Properties, BlockBehaviour.StateArgumentPredicate<A>, BlockBehaviour.StatePredicate
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final com.mojang.serialization.MapCodec
<SculkSensorBlock> static final int
static final EnumProperty
<SculkSensorPhase> static final IntegerProperty
private static final float[]
protected static final VoxelShape
static final BooleanProperty
Fields inherited from class net.minecraft.world.level.block.Block
BLOCK_STATE_REGISTRY, INDESTRUCTIBLE, INSTANT, stateDefinition, UPDATE_ALL, UPDATE_ALL_IMMEDIATE, UPDATE_CLIENTS, UPDATE_IMMEDIATE, UPDATE_INVISIBLE, UPDATE_KNOWN_SHAPE, UPDATE_LIMIT, UPDATE_MOVE_BY_PISTON, UPDATE_NEIGHBORS, UPDATE_NONE, UPDATE_SUPPRESS_DROPS
Fields inherited from class net.minecraft.world.level.block.state.BlockBehaviour
drops, dynamicShape, explosionResistance, friction, hasCollision, isRandomlyTicking, jumpFactor, properties, requiredFeatures, soundType, speedFactor, UPDATE_SHAPE_ORDER
Fields inherited from interface net.minecraft.world.flag.FeatureElement
FILTERED_REGISTRIES
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
activate
(Entity pEntity, Level pLevel, BlockPos pPos, BlockState pState, int pPower, int pFrequency) void
animateTick
(BlockState pState, Level pLevel, BlockPos pPos, RandomSource pRandom) Called periodically clientside on blocks near the player to show effects (like furnace fire particles).static boolean
canActivate
(BlockState pState) com.mojang.serialization.MapCodec
<? extends SculkSensorBlock> codec()
protected void
static void
deactivate
(Level pLevel, BlockPos pPos, BlockState pState) int
protected int
getAnalogOutputSignal
(BlockState pState, Level pLevel, BlockPos pPos) Returns the analog signal this block emits.int
getDirectSignal
(BlockState pState, BlockGetter pLevel, BlockPos pPos, Direction pDirection) Returns the direct signal this block emits in the given direction.int
getExpDrop
(BlockState state, LevelAccessor level, BlockPos pos, BlockEntity blockEntity, Entity breaker, ItemStack tool) Returns how many experience points this block drops when broken, before application of enchantments.protected FluidState
getFluidState
(BlockState pState) static SculkSensorPhase
getPhase
(BlockState pState) protected RenderShape
getRenderShape
(BlockState pState) The type of render function called.protected VoxelShape
getShape
(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) protected int
getSignal
(BlockState pState, BlockGetter pLevel, BlockPos pPos, Direction pDirection) Returns the signal this block emits in the given direction.getStateForPlacement
(BlockPlaceContext pContext) <T extends BlockEntity>
BlockEntityTicker<T> getTicker
(Level pLevel, BlockState pState, BlockEntityType<T> pBlockEntityType) protected boolean
hasAnalogOutputSignal
(BlockState pState) protected boolean
isPathfindable
(BlockState pState, PathComputationType pPathComputationType) protected boolean
isSignalSource
(BlockState pState) Returns whether this block is capable of emitting redstone signals.newBlockEntity
(BlockPos pPos, BlockState pState) protected void
onPlace
(BlockState pState, Level pLevel, BlockPos pPos, BlockState pOldState, boolean pMovedByPiston) protected void
onRemove
(BlockState pState, Level pLevel, BlockPos pPos, BlockState pNewState, boolean pMovedByPiston) protected void
spawnAfterBreak
(BlockState pState, ServerLevel pLevel, BlockPos pPos, ItemStack pStack, boolean pDropExperience) Perform side-effects from block dropping, such as creating silverfishvoid
stepOn
(Level pLevel, BlockPos pPos, BlockState pState, Entity pEntity) protected void
tick
(BlockState pState, ServerLevel pLevel, BlockPos pPos, RandomSource pRandom) static void
tryResonateVibration
(Entity pEntity, Level pLevel, BlockPos pPos, int pFrequency) private static void
updateNeighbours
(Level pLevel, BlockPos pPos, BlockState pState) protected BlockState
updateShape
(BlockState pState, Direction pDirection, BlockState pNeighborState, LevelAccessor pLevel, BlockPos pPos, BlockPos pNeighborPos) Update the provided state given the provided neighbor direction and neighbor state, returning a new state.protected boolean
useShapeForLightOcclusion
(BlockState pState) Methods inherited from class net.minecraft.world.level.block.BaseEntityBlock
createTickerHelper, getMenuProvider, triggerEvent
Methods inherited from class net.minecraft.world.level.block.Block
appendHoverText, asBlock, asItem, box, builtInRegistryHolder, byItem, canSupportCenter, canSupportRigidBlock, defaultBlockState, destroy, dropFromExplosion, dropResources, dropResources, dropResources, fallOn, getCloneItemStack, getDescriptionId, getDrops, getDrops, getExplosionResistance, getFriction, getId, getJumpFactor, getName, getShapeForEachState, getSpeedFactor, getStateDefinition, handlePrecipitation, hasDynamicShape, initializeClient, isExceptionForConnection, isFaceFull, isPossibleToRespawnInThis, isShapeFullBlock, playerDestroy, playerWillDestroy, popExperience, popResource, popResourceFromFace, pushEntitiesUp, registerDefaultState, setPlacedBy, shouldRenderFace, spawnDestroyParticles, stateById, toString, tryDropExperience, updateEntityAfterFallOn, updateFromNeighbourShapes, updateOrDestroy, updateOrDestroy, wasExploded, withPropertiesOf
Methods inherited from class net.minecraft.world.level.block.state.BlockBehaviour
attack, canBeReplaced, canBeReplaced, canSurvive, defaultDestroyTime, defaultMapColor, entityInside, getBlockSupportShape, getCollisionShape, getDestroyProgress, getDrops, getInteractionShape, getLightBlock, getLootTable, getMaxHorizontalOffset, getMaxVerticalOffset, getOcclusionShape, getSeed, getShadeBrightness, getSoundType, getVisualShape, isAir, isCollisionShapeFullBlock, isOcclusionShapeFullBlock, isRandomlyTicking, mirror, neighborChanged, onExplosionHit, onProjectileHit, propagatesSkylightDown, properties, propertiesCodec, randomTick, requiredFeatures, rotate, simpleCodec, skipRendering, updateIndirectNeighbourShapes, useItemOn, useWithoutItem
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.world.level.block.EntityBlock
getListener
Methods inherited from interface net.minecraft.world.flag.FeatureElement
isEnabled
Methods inherited from interface net.neoforged.neoforge.common.extensions.IBlockExtension
addLandingEffects, addRunningEffects, canBeHydrated, canConnectRedstone, canDropFromExplosion, canEntityDestroy, canHarvestBlock, canStickTo, canSustainPlant, collisionExtendsVertically, getAdjacentBlockPathType, getAppearance, getBeaconColorMultiplier, getBedDirection, getBlockPathType, getBubbleColumnDirection, getCloneItemStack, getEnchantPowerBonus, getExplosionResistance, getFireSpreadSpeed, getFlammability, getFriction, getLightEmission, getMapColor, getPistonPushReaction, getRespawnPosition, getSoundType, getStateAtViewpoint, getToolModifiedState, getWeakChanges, hasDynamicLightEmission, hidesNeighborFace, isBed, isBurning, isConduitFrame, isEmpty, isFertile, isFireSource, isFlammable, isLadder, isPortalFrame, isScaffolding, isSlimeBlock, isStickyBlock, makesOpenTrapdoorAboveClimbable, onBlockExploded, onBlockStateChange, onCaughtFire, onDestroyedByPlayer, onDestroyedByPushReaction, onNeighborChange, onTreeGrow, rotate, setBedOccupied, shouldCheckWeakPower, shouldDisplayFluidOverlay, shouldHideAdjacentFluidFace, supportsExternalFaceHiding
Methods inherited from interface net.neoforged.neoforge.common.extensions.IBucketPickupExtension
getPickupSound
Methods inherited from interface net.minecraft.world.level.block.SimpleWaterloggedBlock
canPlaceLiquid, getPickupSound, pickupBlock, placeLiquid
-
Field Details
-
CODEC
-
ACTIVE_TICKS
public static final int ACTIVE_TICKS- See Also:
-
COOLDOWN_TICKS
public static final int COOLDOWN_TICKS- See Also:
-
PHASE
-
POWER
-
WATERLOGGED
-
SHAPE
-
RESONANCE_PITCH_BEND
private static final float[] RESONANCE_PITCH_BEND
-
-
Constructor Details
-
SculkSensorBlock
-
-
Method Details
-
codec
- Specified by:
codec
in classBaseEntityBlock
-
getStateForPlacement
- Overrides:
getStateForPlacement
in classBlock
-
getFluidState
- Overrides:
getFluidState
in classBlockBehaviour
-
tick
- Overrides:
tick
in classBlockBehaviour
-
stepOn
-
onPlace
protected void onPlace(BlockState pState, Level pLevel, BlockPos pPos, BlockState pOldState, boolean pMovedByPiston) - Overrides:
onPlace
in classBlockBehaviour
-
onRemove
protected void onRemove(BlockState pState, Level pLevel, BlockPos pPos, BlockState pNewState, boolean pMovedByPiston) - Overrides:
onRemove
in classBlockBehaviour
-
updateShape
protected BlockState updateShape(BlockState pState, Direction pDirection, BlockState pNeighborState, LevelAccessor pLevel, BlockPos pPos, BlockPos pNeighborPos) Update the provided state given the provided neighbor direction and neighbor state, returning a new state. For example, fences make their connections to the passed in state if possible, and wet concrete powder immediately returns its solidified counterpart. Note that this method should ideally consider only the specific direction passed in.- Overrides:
updateShape
in classBlockBehaviour
-
updateNeighbours
-
newBlockEntity
- Specified by:
newBlockEntity
in interfaceEntityBlock
-
getTicker
@Nullable public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level pLevel, BlockState pState, BlockEntityType<T> pBlockEntityType) - Specified by:
getTicker
in interfaceEntityBlock
-
getRenderShape
The type of render function called. MODEL for mixed tesr and static model, MODELBLOCK_ANIMATED for TESR-only, LIQUID for vanilla liquids, INVISIBLE to skip all rendering- Overrides:
getRenderShape
in classBaseEntityBlock
-
getShape
protected VoxelShape getShape(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) - Overrides:
getShape
in classBlockBehaviour
-
isSignalSource
Returns whether this block is capable of emitting redstone signals.- Overrides:
isSignalSource
in classBlockBehaviour
-
getSignal
Returns the signal this block emits in the given direction.NOTE: directions in redstone signal related methods are backwards, so this method checks for the signal emitted in the opposite direction of the one given.
- Overrides:
getSignal
in classBlockBehaviour
-
getDirectSignal
public int getDirectSignal(BlockState pState, BlockGetter pLevel, BlockPos pPos, Direction pDirection) Returns the direct signal this block emits in the given direction.NOTE: directions in redstone signal related methods are backwards, so this method checks for the signal emitted in the opposite direction of the one given.
- Overrides:
getDirectSignal
in classBlockBehaviour
-
getPhase
-
canActivate
-
deactivate
-
getActiveTicks
public int getActiveTicks() -
activate
public void activate(@Nullable Entity pEntity, Level pLevel, BlockPos pPos, BlockState pState, int pPower, int pFrequency) -
tryResonateVibration
-
animateTick
Called periodically clientside on blocks near the player to show effects (like furnace fire particles).- Overrides:
animateTick
in classBlock
-
createBlockStateDefinition
- Overrides:
createBlockStateDefinition
in classBlock
-
hasAnalogOutputSignal
- Overrides:
hasAnalogOutputSignal
in classBlockBehaviour
-
getAnalogOutputSignal
Returns the analog signal this block emits. This is the signal a comparator can read from it.- Overrides:
getAnalogOutputSignal
in classBlockBehaviour
-
isPathfindable
- Overrides:
isPathfindable
in classBlockBehaviour
-
useShapeForLightOcclusion
- Overrides:
useShapeForLightOcclusion
in classBlockBehaviour
-
spawnAfterBreak
protected void spawnAfterBreak(BlockState pState, ServerLevel pLevel, BlockPos pPos, ItemStack pStack, boolean pDropExperience) Perform side-effects from block dropping, such as creating silverfish- Overrides:
spawnAfterBreak
in classBlockBehaviour
-
getExpDrop
public int getExpDrop(BlockState state, LevelAccessor level, BlockPos pos, @Nullable BlockEntity blockEntity, @Nullable Entity breaker, ItemStack tool) Description copied from interface:IBlockExtension
Returns how many experience points this block drops when broken, before application of enchantments.- Specified by:
getExpDrop
in interfaceIBlockExtension
- Parameters:
state
- The state of the block being brokenlevel
- The levelpos
- The position of the block being brokenblockEntity
- The block entity, if anybreaker
- The entity who broke the block, if knowntool
- The item stack used to break the block. May be empty- Returns:
- The amount of experience points dropped by this block
-