public class TntBlock extends Block
Block.NeighborGroupAbstractBlock.AbstractBlockState, AbstractBlock.ContextPredicate, AbstractBlock.OffsetType, AbstractBlock.Settings, AbstractBlock.TypedContextPredicate<A>| Modifier and Type | Field and Description |
|---|---|
static BooleanProperty |
UNSTABLE |
LOGGER, STATE_IDS, stateManagercollidable, dynamicBounds, FACINGS, jumpVelocityMultiplier, lootTableId, material, randomTicks, resistance, settings, slipperiness, soundGroup, velocityMultiplier| Constructor and Description |
|---|
TntBlock(AbstractBlock.Settings settings) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
appendProperties(StateManager.Builder<Block,BlockState> builder) |
void |
neighborUpdate(BlockState state,
World world,
BlockPos pos,
Block block,
BlockPos fromPos,
boolean notify) |
void |
onBlockAdded(BlockState state,
World world,
BlockPos pos,
BlockState oldState,
boolean notify) |
void |
onBreak(World world,
BlockPos pos,
BlockState state,
PlayerEntity player) |
void |
onDestroyedByExplosion(World world,
BlockPos pos,
Explosion explosion)
Called when this block is destroyed by an explosion.
|
void |
onProjectileHit(World world,
BlockState state,
BlockHitResult hit,
ProjectileEntity projectile) |
ActionResult |
onUse(BlockState state,
World world,
BlockPos pos,
PlayerEntity player,
Hand hand,
BlockHitResult hit)
Called when this block is used by a player.
|
static void |
primeTnt(World world,
BlockPos pos) |
private static void |
primeTnt(World world,
BlockPos pos,
LivingEntity igniter) |
boolean |
shouldDropItemsOnExplosion(Explosion explosion) |
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, is, isFaceFullSquare, isIn, isShapeFullCube, isTranslucent, onBroken, onEntityLand, onLandedUpon, onPlaced, onSteppedOn, postProcessState, pushEntitiesUpBeforeBlockChange, rainTick, randomDisplayTick, replace, replace, setDefaultState, shouldDrawSide, sideCoversSmallSquare, toStringcalcBlockBreakingDelta, canBucketPlace, canPathfindThrough, canPlaceAt, canReplace, createScreenHandlerFactory, emitsRedstonePower, getAmbientOcclusionLightLevel, getCollisionShape, getComparatorOutput, getCullingShape, getDefaultMaterialColor, getDroppedStacks, getFluidState, getLootTableId, getOffsetType, getOpacity, getOutlineShape, getPistonBehavior, getRaycastShape, getRenderingSeed, getRenderType, getSidesShape, getStateForNeighborUpdate, getStrongRedstonePower, getVisualShape, getWeakRedstonePower, hasBlockEntity, hasComparatorOutput, hasSidedTransparency, isSideInvisible, mirror, onBlockBreakStart, onEntityCollision, onStacksDropped, onStateReplaced, onSyncedBlockEvent, prepare, randomTick, rotate, scheduledTickpublic static final BooleanProperty UNSTABLE
public TntBlock(AbstractBlock.Settings settings)
public void onBlockAdded(BlockState state, World world, BlockPos pos, BlockState oldState, boolean notify)
onBlockAdded in class AbstractBlockpublic void neighborUpdate(BlockState state, World world, BlockPos pos, Block block, BlockPos fromPos, boolean notify)
neighborUpdate in class AbstractBlockpublic void onBreak(World world, BlockPos pos, BlockState state, PlayerEntity player)
public void onDestroyedByExplosion(World world, BlockPos pos, Explosion explosion)
onDestroyedByExplosion in class Blockprivate static void primeTnt(World world, BlockPos pos, @Nullable LivingEntity igniter)
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit)
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.
onUse in class AbstractBlockpublic void onProjectileHit(World world, BlockState state, BlockHitResult hit, ProjectileEntity projectile)
onProjectileHit in class AbstractBlockpublic boolean shouldDropItemsOnExplosion(Explosion explosion)
shouldDropItemsOnExplosion in class Blockprotected void appendProperties(StateManager.Builder<Block,BlockState> builder)
appendProperties in class Block