Package net.minecraft.block
Class ShulkerBoxBlock
java.lang.Object
net.minecraft.block.AbstractBlock
net.minecraft.block.Block
net.minecraft.block.BlockWithEntity
net.minecraft.block.ShulkerBoxBlock
- All Implemented Interfaces:
BlockEntityProvider
,ItemConvertible
public class ShulkerBoxBlock extends BlockWithEntity
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.block.Block
Block.NeighborGroup
Nested 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 private DyeColor
color
static Identifier
CONTENTS
static EnumProperty<Direction>
FACING
Fields inherited from class net.minecraft.block.Block
LOGGER, STATE_IDS, stateManager
Fields inherited from class net.minecraft.block.AbstractBlock
collidable, dynamicBounds, FACINGS, jumpVelocityMultiplier, lootTableId, material, randomTicks, resistance, settings, slipperiness, soundGroup, velocityMultiplier
-
Constructor Summary
Constructors Constructor Description ShulkerBoxBlock(DyeColor color, AbstractBlock.Settings settings)
-
Method Summary
Methods inherited from class net.minecraft.block.BlockWithEntity
createScreenHandlerFactory, onSyncedBlockEvent
Methods inherited from class net.minecraft.block.Block
addStacksForDisplay, afterBreak, asBlock, asItem, canMobSpawnInside, cannotConnect, createCuboidShape, dropExperience, dropStack, dropStacks, dropStacks, dropStacks, getBlastResistance, getBlockFromItem, getDefaultState, getDroppedStacks, getDroppedStacks, getJumpVelocityMultiplier, getName, getRawIdFromState, getSlipperiness, getSoundGroup, getStateFromRawId, getStateManager, getTranslationKey, getVelocityMultiplier, hasDynamicBounds, hasRandomTicks, hasTopRim, is, isFaceFullSquare, isIn, isShapeFullCube, isTranslucent, onBroken, onDestroyedByExplosion, onEntityLand, onLandedUpon, onSteppedOn, postProcessState, pushEntitiesUpBeforeBlockChange, rainTick, randomDisplayTick, replace, replace, setDefaultState, shouldDrawSide, shouldDropItemsOnExplosion, sideCoversSmallSquare, toString
Methods inherited from class net.minecraft.block.AbstractBlock
calcBlockBreakingDelta, canBucketPlace, canPathfindThrough, canPlaceAt, canReplace, emitsRedstonePower, getAmbientOcclusionLightLevel, getCollisionShape, getCullingShape, getDefaultMaterialColor, getFluidState, getLootTableId, getOffsetType, getOpacity, getRaycastShape, getRenderingSeed, getSidesShape, getStateForNeighborUpdate, getStrongRedstonePower, getVisualShape, getWeakRedstonePower, hasBlockEntity, hasSidedTransparency, isSideInvisible, neighborUpdate, onBlockAdded, onBlockBreakStart, onEntityCollision, onProjectileHit, onStacksDropped, prepare, randomTick, scheduledTick
-
Field Details
-
FACING
-
CONTENTS
-
color
-
-
Constructor Details
-
ShulkerBoxBlock
-
-
Method Details
-
createBlockEntity
-
getRenderType
- Overrides:
getRenderType
in classBlockWithEntity
-
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:
onUse
in classAbstractBlock
- Returns:
- an action result that specifies if using the block was successful.
-
getPlacementState
- Overrides:
getPlacementState
in classBlock
-
appendProperties
- Overrides:
appendProperties
in classBlock
-
onBreak
-
getDroppedStacks
- Overrides:
getDroppedStacks
in classAbstractBlock
-
onPlaced
public void onPlaced(World world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack itemStack) -
onStateReplaced
public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved)Called inWorldChunk.setBlockState(BlockPos, BlockState, boolean)
ifnewState
is different fromstate
. Vanilla blocks perform removal cleanups here.- Overrides:
onStateReplaced
in classAbstractBlock
-
appendTooltip
@Environment(CLIENT) public void appendTooltip(ItemStack stack, @Nullable BlockView world, List<Text> tooltip, TooltipContext options)- Overrides:
appendTooltip
in classBlock
-
getPistonBehavior
- Overrides:
getPistonBehavior
in classAbstractBlock
-
getOutlineShape
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context)- Overrides:
getOutlineShape
in classAbstractBlock
-
hasComparatorOutput
- Overrides:
hasComparatorOutput
in classAbstractBlock
-
getComparatorOutput
- Overrides:
getComparatorOutput
in classAbstractBlock
-
getPickStack
@Environment(CLIENT) public ItemStack getPickStack(BlockView world, BlockPos pos, BlockState state)- Overrides:
getPickStack
in classBlock
-
getColor
-
getColor
-
get
-
getColor
-
getItemStack
-
rotate
Applies a block rotation to a block state.By default, this returns the provided block state.
- Overrides:
rotate
in classAbstractBlock
- Returns:
- the rotated block state
-
mirror
- Overrides:
mirror
in classAbstractBlock
-