Package net.minecraft.world.level.block
Class TntBlock
java.lang.Object
net.minecraft.world.level.block.state.BlockBehaviour
net.minecraft.world.level.block.Block
net.minecraft.world.level.block.TntBlock
- All Implemented Interfaces:
FeatureElement
,ItemLike
,IBlockExtension
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.level.block.Block
Block.ShapePairKey
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 com.mojang.serialization.MapCodec
<TntBlock> 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_SKIP_ALL_SIDEEFFECTS, UPDATE_SKIP_BLOCK_ENTITY_SIDEEFFECTS, UPDATE_SKIP_ON_PLACE, UPDATE_SKIP_SHAPE_UPDATE_ON_WIRE, UPDATE_SUPPRESS_DROPS
Fields inherited from class net.minecraft.world.level.block.state.BlockBehaviour
descriptionId, 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 TypeMethodDescriptioncom.mojang.serialization.MapCodec
<TntBlock> codec()
protected void
boolean
dropFromExplosion
(Explosion pExplosion) protected void
neighborChanged
(BlockState pState, Level pLevel, BlockPos pPos, Block pNeighborBlock, Orientation pOrientation, boolean pMovedByPiston) boolean
onCaughtFire
(BlockState state, Level world, BlockPos pos, Direction face, LivingEntity igniter) If the block is flammable, this is called when it gets lit on fire.protected void
onPlace
(BlockState pState, Level pLevel, BlockPos pPos, BlockState pOldState, boolean pIsMoving) protected void
onProjectileHit
(Level pLevel, BlockState pState, BlockHitResult pHit, Projectile pProjectile) playerWillDestroy
(Level pLevel, BlockPos pPos, BlockState pState, Player pPlayer) static boolean
Deprecated.Neo: use invalid input: '{@link net.neoforged.neoforge.common.extensions.IBlockStateExtension#' onCaughtFire(Level,BlockPos,net.minecraft.core.Direction, LivingEntity)} insteadprivate static boolean
prime
(Level pLevel, BlockPos pPos, LivingEntity pEntity) Deprecated.Neo: use invalid input: '{@link net.neoforged.neoforge.common.extensions.IBlockStateExtension#' onCaughtFire(Level,BlockPos,net.minecraft.core.Direction, LivingEntity)} insteadprotected InteractionResult
useItemOn
(ItemStack pStack, BlockState pState, Level pLevel, BlockPos pPos, Player pPlayer, InteractionHand pHand, BlockHitResult pHitResult) void
wasExploded
(ServerLevel pLevel, BlockPos pPos, Explosion pExplosion) Methods inherited from class net.minecraft.world.level.block.Block
animateTick, asBlock, asItem, box, boxes, boxZ, boxZ, boxZ, builtInRegistryHolder, byItem, canSupportCenter, canSupportRigidBlock, column, column, cube, cube, defaultBlockState, destroy, dropResources, dropResources, dropResources, fallOn, getDrops, getDrops, getExplosionResistance, getFriction, getId, getJumpFactor, getName, getShapeForEachState, getShapeForEachState, getSpeedFactor, getStateDefinition, getStateForPlacement, handlePrecipitation, hasDynamicShape, isExceptionForConnection, isFaceFull, isPossibleToRespawnInThis, isShapeFullBlock, playerDestroy, popExperience, popResource, popResourceFromFace, pushEntitiesUp, registerDefaultState, setPlacedBy, shouldRenderFace, shouldRenderFace, spawnDestroyParticles, stateById, stepOn, toString, tryDropExperience, updateEntityMovementAfterFallOn, updateFromNeighbourShapes, updateOrDestroy, updateOrDestroy, withPropertiesOf
Methods inherited from class net.minecraft.world.level.block.state.BlockBehaviour
affectNeighborsAfterRemoval, attack, canBeReplaced, canBeReplaced, canSurvive, defaultDestroyTime, defaultMapColor, entityInside, getAnalogOutputSignal, getBlockSupportShape, getCloneItemStack, getCollisionShape, getDescriptionId, getDestroyProgress, getDirectSignal, getDrops, getEntityInsideCollisionShape, getFluidState, getInteractionShape, getLightBlock, getLootTable, getMaxHorizontalOffset, getMaxVerticalOffset, getMenuProvider, getOcclusionShape, getRenderShape, getSeed, getShadeBrightness, getShape, getSignal, getSoundType, getVisualShape, hasAnalogOutputSignal, isAir, isCollisionShapeFullBlock, isPathfindable, isRandomlyTicking, isSignalSource, mirror, onExplosionHit, propagatesSkylightDown, properties, propertiesCodec, randomTick, requiredFeatures, rotate, simpleCodec, skipRendering, spawnAfterBreak, tick, triggerEvent, updateIndirectNeighbourShapes, updateShape, useShapeForLightOcclusion, 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.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, getExpDrop, 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, onDestroyedByPlayer, onDestroyedByPushReaction, onNeighborChange, onTreeGrow, playFallSound, playStepSound, rotate, setBedOccupied, shouldCheckWeakPower, shouldDisplayFluidOverlay, shouldHideAdjacentFluidFace, supportsExternalFaceHiding
-
Field Details
-
CODEC
-
UNSTABLE
-
-
Constructor Details
-
TntBlock
-
-
Method Details
-
codec
-
onPlace
protected void onPlace(BlockState pState, Level pLevel, BlockPos pPos, BlockState pOldState, boolean pIsMoving) - Overrides:
onPlace
in classBlockBehaviour
-
neighborChanged
protected void neighborChanged(BlockState pState, Level pLevel, BlockPos pPos, Block pNeighborBlock, @Nullable Orientation pOrientation, boolean pMovedByPiston) - Overrides:
neighborChanged
in classBlockBehaviour
-
playerWillDestroy
- Overrides:
playerWillDestroy
in classBlock
-
wasExploded
- Overrides:
wasExploded
in classBlock
-
prime
Deprecated.Neo: use invalid input: '{@link net.neoforged.neoforge.common.extensions.IBlockStateExtension#' onCaughtFire(Level,BlockPos,net.minecraft.core.Direction, LivingEntity)} instead -
prime
@Deprecated private static boolean prime(Level pLevel, BlockPos pPos, @Nullable LivingEntity pEntity) Deprecated.Neo: use invalid input: '{@link net.neoforged.neoforge.common.extensions.IBlockStateExtension#' onCaughtFire(Level,BlockPos,net.minecraft.core.Direction, LivingEntity)} instead -
useItemOn
protected InteractionResult useItemOn(ItemStack pStack, BlockState pState, Level pLevel, BlockPos pPos, Player pPlayer, InteractionHand pHand, BlockHitResult pHitResult) - Overrides:
useItemOn
in classBlockBehaviour
-
onProjectileHit
protected void onProjectileHit(Level pLevel, BlockState pState, BlockHitResult pHit, Projectile pProjectile) - Overrides:
onProjectileHit
in classBlockBehaviour
-
dropFromExplosion
- Overrides:
dropFromExplosion
in classBlock
- Returns:
- whether this block should drop its drops when destroyed by the given explosion
-
createBlockStateDefinition
- Overrides:
createBlockStateDefinition
in classBlock
-
onCaughtFire
public boolean onCaughtFire(BlockState state, Level world, BlockPos pos, @Nullable Direction face, @Nullable LivingEntity igniter) Description copied from interface:IBlockExtension
If the block is flammable, this is called when it gets lit on fire.The return value determines whether a flint-and-steel in a dispenser was used successfully and should be damaged
- Parameters:
state
- The current stateworld
- The current levelpos
- Block position in levelface
- The direction that the fire is coming fromigniter
- The entity that lit the fire- Returns:
- whether the block was successfully set on fire (i.e. TNT is allowed to explode and was primed)
-