Class HopperBlock
- All Implemented Interfaces:
BlockEntityProvider
,ItemConvertible
,ToggleableFeature
- Mappings:
Namespace Name named net/minecraft/block/HopperBlock
intermediary net/minecraft/class_2377
official djt
-
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.Offsetter, AbstractBlock.OffsetType, AbstractBlock.Settings, AbstractBlock.TypedContextPredicate<A>
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec
<HopperBlock> private static final VoxelShape
private static final VoxelShape
private static final VoxelShape
private static final VoxelShape
private static final VoxelShape
static final BooleanProperty
static final DirectionProperty
private static final VoxelShape
private static final VoxelShape
private static final VoxelShape
private static final VoxelShape
private static final VoxelShape
private static final VoxelShape
private static final VoxelShape
private static final VoxelShape
private static final VoxelShape
private static final VoxelShape
Fields inherited from class net.minecraft.block.Block
field_31023, field_31024, field_31025, field_31035, FORCE_STATE, MOVED, NO_REDRAW, NOTIFY_ALL, NOTIFY_ALL_AND_REDRAW, NOTIFY_LISTENERS, NOTIFY_NEIGHBORS, REDRAW_ON_MAIN_THREAD, SKIP_DROPS, STATE_IDS, stateManager
Fields inherited from class net.minecraft.block.AbstractBlock
collidable, DIRECTIONS, dynamicBounds, jumpVelocityMultiplier, lootTableKey, randomTicks, requiredFeatures, resistance, settings, slipperiness, soundGroup, velocityMultiplier
Fields inherited from interface net.minecraft.resource.featuretoggle.ToggleableFeature
FEATURE_ENABLED_REGISTRY_KEYS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
appendProperties
(StateManager.Builder<Block, BlockState> builder) Appends block state properties to this block.protected boolean
canPathfindThrough
(BlockState state, NavigationType type) Returns if an entity using navigation typetype
can navigate through this block.createBlockEntity
(BlockPos pos, BlockState state) Returns a new block entity instance.com.mojang.serialization.MapCodec
<HopperBlock> getCodec()
protected int
getComparatorOutput
(BlockState state, World world, BlockPos pos) Returns the comparator output of the block, from0
to15
.protected VoxelShape
getOutlineShape
(BlockState state, BlockView world, BlockPos pos, ShapeContext context) protected VoxelShape
getRaycastShape
(BlockState state, BlockView world, BlockPos pos) protected BlockRenderType
getRenderType
(BlockState state) Returns the block's render type (invisible, animated, model).<T extends BlockEntity>
@Nullable BlockEntityTicker<T> getTicker
(World world, BlockState state, BlockEntityType<T> type) Returns the "ticker" for the block's block entity, ornull
if the block entity does not need to be ticked.protected boolean
hasComparatorOutput
(BlockState state) Returns whether the block can have a comparator output.protected BlockState
mirror
(BlockState state, BlockMirror mirror) Returnsstate
mirrored bymirror
.protected void
neighborUpdate
(BlockState state, World world, BlockPos pos, Block sourceBlock, BlockPos sourcePos, boolean notify) Called when a neighboring block is updated.protected void
onBlockAdded
(BlockState state, World world, BlockPos pos, BlockState oldState, boolean notify) Called server-side on the new block when the block state is changed.protected void
onEntityCollision
(BlockState state, World world, BlockPos pos, Entity entity) Called when the entity's collision box intersects the block.protected void
onStateReplaced
(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) Called server-side on the old block when the block state is changed.protected ActionResult
onUse
(BlockState state, World world, BlockPos pos, PlayerEntity player, BlockHitResult hit) protected BlockState
rotate
(BlockState state, BlockRotation rotation) Returnsstate
rotated byrotation
.private void
updateEnabled
(World world, BlockPos pos, BlockState state) Methods inherited from class net.minecraft.block.BlockWithEntity
createScreenHandlerFactory, onSyncedBlockEvent, validateTicker
Methods inherited from class net.minecraft.block.Block
afterBreak, appendTooltip, asBlock, asItem, canMobSpawnInside, cannotConnect, createCuboidShape, dropExperience, dropExperienceWhenMined, dropStack, dropStack, dropStacks, dropStacks, dropStacks, getBlastResistance, getBlockFromItem, getDefaultState, getDroppedStacks, getDroppedStacks, getJumpVelocityMultiplier, getName, getPickStack, getRawIdFromState, getRegistryEntry, getShapesForStates, getSlipperiness, getStateFromRawId, getStateManager, getStateWithProperties, getTranslationKey, getVelocityMultiplier, hasDynamicBounds, hasTopRim, isFaceFullSquare, isShapeFullCube, onBreak, onBroken, onDestroyedByExplosion, onEntityLand, onLandedUpon, onPlaced, onSteppedOn, postProcessState, precipitationTick, pushEntitiesUpBeforeBlockChange, randomDisplayTick, replace, replace, setDefaultState, shouldDrawSide, shouldDropItemsOnExplosion, sideCoversSmallSquare, spawnBreakParticles, toString
Methods inherited from class net.minecraft.block.AbstractBlock
calcBlockBreakingDelta, canBucketPlace, canPlaceAt, canReplace, createCodec, createSettingsCodec, emitsRedstonePower, getAmbientOcclusionLightLevel, getCameraCollisionShape, getCollisionShape, getCullingShape, getDefaultMapColor, getDroppedStacks, getFluidState, getHardness, getLootTableKey, getMaxHorizontalModelOffset, getOpacity, getRenderingSeed, getRequiredFeatures, getSettings, getSidesShape, getSoundGroup, getStateForNeighborUpdate, getStrongRedstonePower, getVerticalModelOffsetMultiplier, getWeakRedstonePower, hasRandomTicks, hasSidedTransparency, isCullingShapeFullCube, isShapeFullCube, isSideInvisible, isTransparent, onBlockBreakStart, onExploded, onProjectileHit, onStacksDropped, onUseWithItem, prepare, randomTick, scheduledTick
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.block.BlockEntityProvider
getGameEventListener
Methods inherited from interface net.minecraft.resource.featuretoggle.ToggleableFeature
isEnabled
-
Field Details
-
CODEC
- Mappings:
Namespace Name Mixin selector named CODEC
Lnet/minecraft/block/HopperBlock;CODEC:Lcom/mojang/serialization/MapCodec;
intermediary field_46370
Lnet/minecraft/class_2377;field_46370:Lcom/mojang/serialization/MapCodec;
official a
Ldjt;a:Lcom/mojang/serialization/MapCodec;
-
FACING
- Mappings:
Namespace Name Mixin selector named FACING
Lnet/minecraft/block/HopperBlock;FACING:Lnet/minecraft/state/property/DirectionProperty;
intermediary field_11129
Lnet/minecraft/class_2377;field_11129:Lnet/minecraft/class_2753;
official b
Ldjt;b:Ldtw;
-
ENABLED
- Mappings:
Namespace Name Mixin selector named ENABLED
Lnet/minecraft/block/HopperBlock;ENABLED:Lnet/minecraft/state/property/BooleanProperty;
intermediary field_11126
Lnet/minecraft/class_2377;field_11126:Lnet/minecraft/class_2746;
official c
Ldjt;c:Ldtt;
-
TOP_SHAPE
- Mappings:
Namespace Name Mixin selector named TOP_SHAPE
Lnet/minecraft/block/HopperBlock;TOP_SHAPE:Lnet/minecraft/util/shape/VoxelShape;
intermediary field_11131
Lnet/minecraft/class_2377;field_11131:Lnet/minecraft/class_265;
official d
Ldjt;d:Lexv;
-
MIDDLE_SHAPE
- Mappings:
Namespace Name Mixin selector named MIDDLE_SHAPE
Lnet/minecraft/block/HopperBlock;MIDDLE_SHAPE:Lnet/minecraft/util/shape/VoxelShape;
intermediary field_11127
Lnet/minecraft/class_2377;field_11127:Lnet/minecraft/class_265;
official e
Ldjt;e:Lexv;
-
OUTSIDE_SHAPE
- Mappings:
Namespace Name Mixin selector named OUTSIDE_SHAPE
Lnet/minecraft/block/HopperBlock;OUTSIDE_SHAPE:Lnet/minecraft/util/shape/VoxelShape;
intermediary field_11121
Lnet/minecraft/class_2377;field_11121:Lnet/minecraft/class_265;
official f
Ldjt;f:Lexv;
-
INSIDE_SHAPE
- Mappings:
Namespace Name Mixin selector named INSIDE_SHAPE
Lnet/minecraft/block/HopperBlock;INSIDE_SHAPE:Lnet/minecraft/util/shape/VoxelShape;
intermediary field_49154
Lnet/minecraft/class_2377;field_49154:Lnet/minecraft/class_265;
official g
Ldjt;g:Lexv;
-
DEFAULT_SHAPE
- Mappings:
Namespace Name Mixin selector named DEFAULT_SHAPE
Lnet/minecraft/block/HopperBlock;DEFAULT_SHAPE:Lnet/minecraft/util/shape/VoxelShape;
intermediary field_11132
Lnet/minecraft/class_2377;field_11132:Lnet/minecraft/class_265;
official h
Ldjt;h:Lexv;
-
DOWN_SHAPE
- Mappings:
Namespace Name Mixin selector named DOWN_SHAPE
Lnet/minecraft/block/HopperBlock;DOWN_SHAPE:Lnet/minecraft/util/shape/VoxelShape;
intermediary field_11120
Lnet/minecraft/class_2377;field_11120:Lnet/minecraft/class_265;
official i
Ldjt;i:Lexv;
-
EAST_SHAPE
- Mappings:
Namespace Name Mixin selector named EAST_SHAPE
Lnet/minecraft/block/HopperBlock;EAST_SHAPE:Lnet/minecraft/util/shape/VoxelShape;
intermediary field_11134
Lnet/minecraft/class_2377;field_11134:Lnet/minecraft/class_265;
official j
Ldjt;j:Lexv;
-
NORTH_SHAPE
- Mappings:
Namespace Name Mixin selector named NORTH_SHAPE
Lnet/minecraft/block/HopperBlock;NORTH_SHAPE:Lnet/minecraft/util/shape/VoxelShape;
intermediary field_11124
Lnet/minecraft/class_2377;field_11124:Lnet/minecraft/class_265;
official k
Ldjt;k:Lexv;
-
SOUTH_SHAPE
- Mappings:
Namespace Name Mixin selector named SOUTH_SHAPE
Lnet/minecraft/block/HopperBlock;SOUTH_SHAPE:Lnet/minecraft/util/shape/VoxelShape;
intermediary field_11122
Lnet/minecraft/class_2377;field_11122:Lnet/minecraft/class_265;
official l
Ldjt;l:Lexv;
-
WEST_SHAPE
- Mappings:
Namespace Name Mixin selector named WEST_SHAPE
Lnet/minecraft/block/HopperBlock;WEST_SHAPE:Lnet/minecraft/util/shape/VoxelShape;
intermediary field_11130
Lnet/minecraft/class_2377;field_11130:Lnet/minecraft/class_265;
official m
Ldjt;m:Lexv;
-
DOWN_RAYCAST_SHAPE
- Mappings:
Namespace Name Mixin selector named DOWN_RAYCAST_SHAPE
Lnet/minecraft/block/HopperBlock;DOWN_RAYCAST_SHAPE:Lnet/minecraft/util/shape/VoxelShape;
intermediary field_11125
Lnet/minecraft/class_2377;field_11125:Lnet/minecraft/class_265;
official n
Ldjt;n:Lexv;
-
EAST_RAYCAST_SHAPE
- Mappings:
Namespace Name Mixin selector named EAST_RAYCAST_SHAPE
Lnet/minecraft/block/HopperBlock;EAST_RAYCAST_SHAPE:Lnet/minecraft/util/shape/VoxelShape;
intermediary field_11133
Lnet/minecraft/class_2377;field_11133:Lnet/minecraft/class_265;
official o
Ldjt;o:Lexv;
-
NORTH_RAYCAST_SHAPE
- Mappings:
Namespace Name Mixin selector named NORTH_RAYCAST_SHAPE
Lnet/minecraft/block/HopperBlock;NORTH_RAYCAST_SHAPE:Lnet/minecraft/util/shape/VoxelShape;
intermediary field_11123
Lnet/minecraft/class_2377;field_11123:Lnet/minecraft/class_265;
official F
Ldjt;F:Lexv;
-
SOUTH_RAYCAST_SHAPE
- Mappings:
Namespace Name Mixin selector named SOUTH_RAYCAST_SHAPE
Lnet/minecraft/block/HopperBlock;SOUTH_RAYCAST_SHAPE:Lnet/minecraft/util/shape/VoxelShape;
intermediary field_11128
Lnet/minecraft/class_2377;field_11128:Lnet/minecraft/class_265;
official G
Ldjt;G:Lexv;
-
WEST_RAYCAST_SHAPE
- Mappings:
Namespace Name Mixin selector named WEST_RAYCAST_SHAPE
Lnet/minecraft/block/HopperBlock;WEST_RAYCAST_SHAPE:Lnet/minecraft/util/shape/VoxelShape;
intermediary field_11135
Lnet/minecraft/class_2377;field_11135:Lnet/minecraft/class_265;
official H
Ldjt;H:Lexv;
-
-
Constructor Details
-
HopperBlock
- Mappings:
Namespace Name Mixin selector named <init>
Lnet/minecraft/block/AbstractBlock;<init>(Lnet/minecraft/block/AbstractBlock$Settings;)V
intermediary <init>
Lnet/minecraft/class_4970;<init>(Lnet/minecraft/class_4970$class_2251;)V
official <init>
Ldtb;<init>(Ldtb$d;)V
-
-
Method Details
-
getCodec
- Specified by:
getCodec
in classBlockWithEntity
- Mappings:
Namespace Name Mixin selector named getCodec
Lnet/minecraft/block/AbstractBlock;getCodec()Lcom/mojang/serialization/MapCodec;
intermediary method_53969
Lnet/minecraft/class_4970;method_53969()Lcom/mojang/serialization/MapCodec;
official a
Ldtb;a()Lcom/mojang/serialization/MapCodec;
-
getOutlineShape
protected VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) - Overrides:
getOutlineShape
in classAbstractBlock
- See Also:
- Mappings:
Namespace Name Mixin selector named getOutlineShape
Lnet/minecraft/block/AbstractBlock;getOutlineShape(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/ShapeContext;)Lnet/minecraft/util/shape/VoxelShape;
intermediary method_9530
Lnet/minecraft/class_4970;method_9530(Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;Lnet/minecraft/class_3726;)Lnet/minecraft/class_265;
official a
Ldtb;a(Ldtc;Ldcc;Ljd;Lexh;)Lexv;
-
getRaycastShape
- Overrides:
getRaycastShape
in classAbstractBlock
- See Also:
- Mappings:
Namespace Name Mixin selector named getRaycastShape
Lnet/minecraft/block/AbstractBlock;getRaycastShape(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/util/shape/VoxelShape;
intermediary method_9584
Lnet/minecraft/class_4970;method_9584(Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;)Lnet/minecraft/class_265;
official a
Ldtb;a(Ldtc;Ldcc;Ljd;)Lexv;
-
getPlacementState
- Overrides:
getPlacementState
in classBlock
- Mappings:
Namespace Name Mixin selector named getPlacementState
Lnet/minecraft/block/Block;getPlacementState(Lnet/minecraft/item/ItemPlacementContext;)Lnet/minecraft/block/BlockState;
intermediary method_9605
Lnet/minecraft/class_2248;method_9605(Lnet/minecraft/class_1750;)Lnet/minecraft/class_2680;
official a
Ldfy;a(Lcyd;)Ldtc;
-
createBlockEntity
Returns a new block entity instance.For example:
@Override public BlockEntity createBlockEntity(BlockPos pos, BlockState state) { return new MyBlockEntity(pos, state); }
- Returns:
- a new block entity instance
- Implementation Note:
- While this is marked as nullable, in practice this should never return
null
.PistonExtensionBlock
is the only block in vanilla that returnsnull
inside the implementation. - Mappings:
Namespace Name Mixin selector named createBlockEntity
Lnet/minecraft/block/BlockEntityProvider;createBlockEntity(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Lnet/minecraft/block/entity/BlockEntity;
intermediary method_10123
Lnet/minecraft/class_2343;method_10123(Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)Lnet/minecraft/class_2586;
official a
Ldiq;a(Ljd;Ldtc;)Ldqh;
-
getTicker
@Nullable public <T extends BlockEntity> @Nullable BlockEntityTicker<T> getTicker(World world, BlockState state, BlockEntityType<T> type) Returns the "ticker" for the block's block entity, ornull
if the block entity does not need to be ticked.Ticker is a functional interface called every tick to tick the block entity on both the client and the server.
Tickers should validate that the passed
type
is the one this block expects, and returnnull
if it isn't. This is to prevent crashes in rare cases where a mismatch occurs between the position's block and block entity.BlockWithEntity.validateTicker(net.minecraft.block.entity.BlockEntityType<A>, net.minecraft.block.entity.BlockEntityType<E>, net.minecraft.block.entity.BlockEntityTicker<? super E>)
can be used to implement the check.Example:
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(World world, BlockState state, BlockEntityType<T> type) { if (type != YourMod.MY_BLOCK_ENTITY_TYPE) return null; // This should be a static method usable as a BlockEntityTicker. return YourBlockEntity::tick; }
- Returns:
- the "ticker" for the block's block entity, or
null
if the block entity does not need to be ticked - Mappings:
Namespace Name Mixin selector named getTicker
Lnet/minecraft/block/BlockEntityProvider;getTicker(Lnet/minecraft/world/World;Lnet/minecraft/block/BlockState;Lnet/minecraft/block/entity/BlockEntityType;)Lnet/minecraft/block/entity/BlockEntityTicker;
intermediary method_31645
Lnet/minecraft/class_2343;method_31645(Lnet/minecraft/class_1937;Lnet/minecraft/class_2680;Lnet/minecraft/class_2591;)Lnet/minecraft/class_5558;
official a
Ldiq;a(Ldcw;Ldtc;Ldqj;)Ldqi;
-
onBlockAdded
protected void onBlockAdded(BlockState state, World world, BlockPos pos, BlockState oldState, boolean notify) Called server-side on the new block when the block state is changed. This includes block placement. When overriding this method,AbstractBlock.getStateForNeighborUpdate(net.minecraft.block.BlockState, net.minecraft.util.math.Direction, net.minecraft.block.BlockState, net.minecraft.world.WorldAccess, net.minecraft.util.math.BlockPos, net.minecraft.util.math.BlockPos)
orneighborUpdate(net.minecraft.block.BlockState, net.minecraft.world.World, net.minecraft.util.math.BlockPos, net.minecraft.block.Block, net.minecraft.util.math.BlockPos, boolean)
should also be overridden. The method is used in the following cases:- When activating a redstone component on placement (used along with
neighborUpdate(net.minecraft.block.BlockState, net.minecraft.world.World, net.minecraft.util.math.BlockPos, net.minecraft.block.Block, net.minecraft.util.math.BlockPos, boolean)
- When resetting a position-dependent state (see
TargetBlock
) - When converting a block on placement (see
WetSpongeBlock
) - When fire lights a portal
- Overrides:
onBlockAdded
in classAbstractBlock
- See Also:
- Mappings:
Namespace Name Mixin selector named onBlockAdded
Lnet/minecraft/block/AbstractBlock;onBlockAdded(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Z)V
intermediary method_9615
Lnet/minecraft/class_4970;method_9615(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Z)V
official b
Ldtb;b(Ldtc;Ldcw;Ljd;Ldtc;Z)V
- When activating a redstone component on placement (used along with
-
onUse
protected ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, BlockHitResult hit) - Overrides:
onUse
in classAbstractBlock
- Mappings:
Namespace Name Mixin selector named onUse
Lnet/minecraft/block/AbstractBlock;onUse(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/util/hit/BlockHitResult;)Lnet/minecraft/util/ActionResult;
intermediary method_55766
Lnet/minecraft/class_4970;method_55766(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_1657;Lnet/minecraft/class_3965;)Lnet/minecraft/class_1269;
official a
Ldtb;a(Ldtc;Ldcw;Ljd;Lcmx;Lewy;)Lbqr;
-
neighborUpdate
protected void neighborUpdate(BlockState state, World world, BlockPos pos, Block sourceBlock, BlockPos sourcePos, boolean notify) Called when a neighboring block is updated. This method should be overridden to perform an action with a side effect, most notably an activation of a redstone component. This can also be used to perform an action changing block states of other blocks, such asSpongeBlock
which absorbs water.To replace the state of the block itself, override
AbstractBlock.getStateForNeighborUpdate(net.minecraft.block.BlockState, net.minecraft.util.math.Direction, net.minecraft.block.BlockState, net.minecraft.world.WorldAccess, net.minecraft.util.math.BlockPos, net.minecraft.util.math.BlockPos)
instead.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
.- Overrides:
neighborUpdate
in classAbstractBlock
- See Also:
- Mappings:
Namespace Name Mixin selector named neighborUpdate
Lnet/minecraft/block/AbstractBlock;neighborUpdate(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/Block;Lnet/minecraft/util/math/BlockPos;Z)V
intermediary method_9612
Lnet/minecraft/class_4970;method_9612(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2248;Lnet/minecraft/class_2338;Z)V
official a
Ldtb;a(Ldtc;Ldcw;Ljd;Ldfy;Ljd;Z)V
-
updateEnabled
- Mappings:
Namespace Name Mixin selector named updateEnabled
Lnet/minecraft/block/HopperBlock;updateEnabled(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
intermediary method_10217
Lnet/minecraft/class_2377;method_10217(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
official a
Ldjt;a(Ldcw;Ljd;Ldtc;)V
-
onStateReplaced
protected void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) Called server-side on the old block when the block state is changed. This includes block removal. This is used to update neighboring blocks when an active redstone power source is removed, or to drop the contents of an inventory. The checkstate.isOf(newState.getBlock())
can be used to see if the block was removed or not.For most block entities,
ItemScatterer.onStateReplaced(net.minecraft.block.BlockState, net.minecraft.block.BlockState, net.minecraft.world.World, net.minecraft.util.math.BlockPos)
provides a good implementation of this method. Make sure to callsuper.onStateReplaced(state, world, pos, newState, moved);
after invokingItemScatterer
methods.- Overrides:
onStateReplaced
in classAbstractBlock
- See Also:
- Mappings:
Namespace Name Mixin selector named onStateReplaced
Lnet/minecraft/block/AbstractBlock;onStateReplaced(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Z)V
intermediary method_9536
Lnet/minecraft/class_4970;method_9536(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Z)V
official a
Ldtb;a(Ldtc;Ldcw;Ljd;Ldtc;Z)V
-
getRenderType
Returns the block's render type (invisible, animated, model).- Overrides:
getRenderType
in classBlockWithEntity
- Returns:
- the block's render type (invisible, animated, model)
- See Also:
- API Note:
BlockWithEntity
overrides this to returnBlockRenderType.INVISIBLE
; therefore, custom blocks extending that class must override it again to render the block.- Mappings:
Namespace Name Mixin selector named getRenderType
Lnet/minecraft/block/AbstractBlock;getRenderType(Lnet/minecraft/block/BlockState;)Lnet/minecraft/block/BlockRenderType;
intermediary method_9604
Lnet/minecraft/class_4970;method_9604(Lnet/minecraft/class_2680;)Lnet/minecraft/class_2464;
official a_
Ldtb;a_(Ldtc;)Ldmf;
-
hasComparatorOutput
Returns whether the block can have a comparator output.This does not check the current comparator output of the block. Use
getComparatorOutput(net.minecraft.block.BlockState, net.minecraft.world.World, net.minecraft.util.math.BlockPos)
in that case.- Overrides:
hasComparatorOutput
in classAbstractBlock
- Returns:
- whether the block can have a comparator output
- See Also:
- Mappings:
Namespace Name Mixin selector named hasComparatorOutput
Lnet/minecraft/block/AbstractBlock;hasComparatorOutput(Lnet/minecraft/block/BlockState;)Z
intermediary method_9498
Lnet/minecraft/class_4970;method_9498(Lnet/minecraft/class_2680;)Z
official c_
Ldtb;c_(Ldtc;)Z
-
getComparatorOutput
Returns the comparator output of the block, from0
to15
.When overriding this,
hasComparatorOutput(net.minecraft.block.BlockState)
must also be overridden.- Overrides:
getComparatorOutput
in classAbstractBlock
- Returns:
- the comparator output of the block, from
0
to15
- See Also:
- Mappings:
Namespace Name Mixin selector named getComparatorOutput
Lnet/minecraft/block/AbstractBlock;getComparatorOutput(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)I
intermediary method_9572
Lnet/minecraft/class_4970;method_9572(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;)I
official a
Ldtb;a(Ldtc;Ldcw;Ljd;)I
-
rotate
Returnsstate
rotated byrotation
.By default, this returns the provided block state.
- Overrides:
rotate
in classAbstractBlock
- Returns:
state
rotated byrotation
- See Also:
- Mappings:
Namespace Name Mixin selector named rotate
Lnet/minecraft/block/AbstractBlock;rotate(Lnet/minecraft/block/BlockState;Lnet/minecraft/util/BlockRotation;)Lnet/minecraft/block/BlockState;
intermediary method_9598
Lnet/minecraft/class_4970;method_9598(Lnet/minecraft/class_2680;Lnet/minecraft/class_2470;)Lnet/minecraft/class_2680;
official a
Ldtb;a(Ldtc;Ldmm;)Ldtc;
-
mirror
Returnsstate
mirrored bymirror
.By default, this returns the provided block state.
- Overrides:
mirror
in classAbstractBlock
- Returns:
state
mirrored bymirror
- See Also:
- Mappings:
Namespace Name Mixin selector named mirror
Lnet/minecraft/block/AbstractBlock;mirror(Lnet/minecraft/block/BlockState;Lnet/minecraft/util/BlockMirror;)Lnet/minecraft/block/BlockState;
intermediary method_9569
Lnet/minecraft/class_4970;method_9569(Lnet/minecraft/class_2680;Lnet/minecraft/class_2415;)Lnet/minecraft/class_2680;
official a
Ldtb;a(Ldtc;Ldkv;)Ldtc;
-
appendProperties
Appends block state properties to this block. To use this, override and callStateManager.Builder.add(net.minecraft.state.property.Property<?>[])
inside the method. SeeProperties
for the list of pre-defined properties.- Overrides:
appendProperties
in classBlock
- Mappings:
Namespace Name Mixin selector named appendProperties
Lnet/minecraft/block/Block;appendProperties(Lnet/minecraft/state/StateManager$Builder;)V
intermediary method_9515
Lnet/minecraft/class_2248;method_9515(Lnet/minecraft/class_2689$class_2690;)V
official a
Ldfy;a(Ldtd$a;)V
-
onEntityCollision
Called when the entity's collision box intersects the block. Therefore, this method is not called for blocks with a collision; useBlock.onSteppedOn(net.minecraft.world.World, net.minecraft.util.math.BlockPos, net.minecraft.block.BlockState, net.minecraft.entity.Entity)
for those blocks.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
.Here are some examples:
CactusBlock
damages the entity.AbstractPressurePlateBlock
triggers.CobwebBlock
slows the entity.EndPortalBlock
teleports the entity.HopperBlock
collects the item entity.
- Overrides:
onEntityCollision
in classAbstractBlock
- See Also:
- Mappings:
Namespace Name Mixin selector named onEntityCollision
Lnet/minecraft/block/AbstractBlock;onEntityCollision(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/Entity;)V
intermediary method_9548
Lnet/minecraft/class_4970;method_9548(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_1297;)V
official a
Ldtb;a(Ldtc;Ldcw;Ljd;Lbsr;)V
-