Package net.minecraft.block
Class TntBlock
java.lang.Object
net.minecraft.block.AbstractBlock
net.minecraft.block.Block
net.minecraft.block.TntBlock
- All Implemented Interfaces:
ItemConvertible
public class TntBlock extends Block
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.block.Block
Block.NeighborGroupNested classes/interfaces inherited from class net.minecraft.block.AbstractBlock
AbstractBlock.AbstractBlockState, AbstractBlock.ContextPredicate, AbstractBlock.OffsetType, AbstractBlock.Settings, AbstractBlock.TypedContextPredicate<A> -
Field Summary
Fields Modifier and Type Field Description static BooleanPropertyUNSTABLEFields inherited from class net.minecraft.block.Block
LOGGER, STATE_IDS, stateManagerFields inherited from class net.minecraft.block.AbstractBlock
collidable, dynamicBounds, FACINGS, jumpVelocityMultiplier, lootTableId, material, randomTicks, resistance, settings, slipperiness, soundGroup, velocityMultiplier -
Constructor Summary
Constructors Constructor Description TntBlock(AbstractBlock.Settings settings) -
Method Summary
Modifier and Type Method Description protected voidappendProperties(StateManager.Builder<Block,BlockState> builder)voidneighborUpdate(BlockState state, World world, BlockPos pos, Block block, BlockPos fromPos, boolean notify)voidonBlockAdded(BlockState state, World world, BlockPos pos, BlockState oldState, boolean notify)voidonBreak(World world, BlockPos pos, BlockState state, PlayerEntity player)voidonDestroyedByExplosion(World world, BlockPos pos, Explosion explosion)Called when this block is destroyed by an explosion.voidonProjectileHit(World world, BlockState state, BlockHitResult hit, ProjectileEntity projectile)ActionResultonUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit)Called when this block is used by a player.static voidprimeTnt(World world, BlockPos pos)private static voidprimeTnt(World world, BlockPos pos, LivingEntity igniter)booleanshouldDropItemsOnExplosion(Explosion explosion)Methods inherited from class net.minecraft.block.Block
addStacksForDisplay, afterBreak, appendTooltip, asBlock, asItem, canMobSpawnInside, cannotConnect, createCuboidShape, dropExperience, dropStack, dropStacks, dropStacks, dropStacks, getBlastResistance, getBlockFromItem, getDefaultState, getDroppedStacks, getDroppedStacks, getJumpVelocityMultiplier, getName, getPickStack, getPlacementState, getRawIdFromState, getSlipperiness, getSoundGroup, getStateFromRawId, getStateManager, getTranslationKey, getVelocityMultiplier, hasDynamicBounds, hasRandomTicks, hasTopRim, isFaceFullSquare, isShapeFullCube, isTranslucent, onBroken, onEntityLand, onLandedUpon, onPlaced, onSteppedOn, postProcessState, precipitationTick, pushEntitiesUpBeforeBlockChange, randomDisplayTick, replace, replace, setDefaultState, shouldDrawSide, sideCoversSmallSquare, toStringMethods inherited from class net.minecraft.block.AbstractBlock
calcBlockBreakingDelta, canBucketPlace, canPathfindThrough, canPlaceAt, canReplace, createScreenHandlerFactory, emitsRedstonePower, getAmbientOcclusionLightLevel, getCollisionShape, getComparatorOutput, getCullingShape, getDefaultMapColor, getDroppedStacks, getFluidState, getLootTableId, getMaxModelOffset, getOffsetType, getOpacity, getOutlineShape, getPistonBehavior, getRaycastShape, getRenderingSeed, getRenderType, getSidesShape, getStateForNeighborUpdate, getStrongRedstonePower, getVisualShape, getWeakRedstonePower, hasComparatorOutput, hasSidedTransparency, isSideInvisible, mirror, onBlockBreakStart, onEntityCollision, onStacksDropped, onStateReplaced, onSyncedBlockEvent, prepare, randomTick, rotate, scheduledTick
-
Field Details
-
UNSTABLE
-
-
Constructor Details
-
TntBlock
-
-
Method Details
-
onBlockAdded
public void onBlockAdded(BlockState state, World world, BlockPos pos, BlockState oldState, boolean notify)- Overrides:
onBlockAddedin classAbstractBlock
-
neighborUpdate
public void neighborUpdate(BlockState state, World world, BlockPos pos, Block block, BlockPos fromPos, boolean notify)- Overrides:
neighborUpdatein classAbstractBlock
-
onBreak
-
onDestroyedByExplosion
Called when this block is destroyed by an explosion.- Overrides:
onDestroyedByExplosionin classBlock
-
primeTnt
-
primeTnt
-
onUse
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit)Called when this block is used by a player. This, by default, is bound to using the right mouse button.This method is called on both the logical client and logical server, so take caution when overriding this method. The logical side can be checked using
world.isClient().If the action result is successful on a logical client, then the action will be sent to the logical server for processing.
- Overrides:
onUsein classAbstractBlock- Returns:
- an action result that specifies if using the block was successful.
-
onProjectileHit
public void onProjectileHit(World world, BlockState state, BlockHitResult hit, ProjectileEntity projectile)- Overrides:
onProjectileHitin classAbstractBlock
-
shouldDropItemsOnExplosion
- Overrides:
shouldDropItemsOnExplosionin classBlock
-
appendProperties
- Overrides:
appendPropertiesin classBlock
-