Class TurtleEggBlock
- All Implemented Interfaces:
ItemConvertible
,ToggleableFeature
- Mappings:
Namespace Name named net/minecraft/block/TurtleEggBlock
intermediary net/minecraft/class_2542
official dtg
-
Nested Class Summary
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
<TurtleEggBlock> static final IntProperty
static final int
static final int
static final int
static final IntProperty
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, SKIP_REDSTONE_WIRE_STATE_REPLACEMENT, STATE_IDS, stateManager
Fields inherited from class net.minecraft.block.AbstractBlock
collidable, DIRECTIONS, dynamicBounds, jumpVelocityMultiplier, lootTableKey, randomTicks, requiredFeatures, resistance, settings, slipperiness, soundGroup, translationKey, velocityMultiplier
Fields inherited from interface net.minecraft.resource.featuretoggle.ToggleableFeature
FEATURE_ENABLED_REGISTRY_KEYS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
afterBreak
(World world, PlayerEntity player, BlockPos pos, BlockState state, @Nullable BlockEntity blockEntity, ItemStack tool) Called server-side when the block is broken by the player using correct tool.protected void
appendProperties
(StateManager.Builder<Block, BlockState> builder) Appends block state properties to this block.private void
breakEgg
(World world, BlockPos pos, BlockState state) private boolean
breaksEgg
(ServerWorld world, Entity entity) protected boolean
canReplace
(BlockState state, ItemPlacementContext context) Returns whether the item can replace the block.com.mojang.serialization.MapCodec
<TurtleEggBlock> getCodec()
protected VoxelShape
getOutlineShape
(BlockState state, BlockView world, BlockPos pos, ShapeContext context) static boolean
static boolean
isSandBelow
(BlockView world, BlockPos pos) 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.void
onLandedUpon
(World world, BlockState state, BlockPos pos, Entity entity, float fallDistance) Called when the entity lands on the block.void
onSteppedOn
(World world, BlockPos pos, BlockState state, Entity entity) Called when an entity steps on this block.protected void
randomTick
(BlockState state, ServerWorld world, BlockPos pos, Random random) Called server-side when a block gets ticked randomly.private boolean
shouldHatchProgress
(World world) private void
tryBreakEgg
(World world, BlockState state, BlockPos pos, Entity entity, int inverseChance) Methods inherited from class net.minecraft.block.Block
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, getVelocityMultiplier, hasDynamicBounds, hasTopRim, isFaceFullSquare, isShapeFullCube, onBreak, onBroken, onDestroyedByExplosion, onEntityLand, onPlaced, postProcessState, precipitationTick, pushEntitiesUpBeforeBlockChange, randomDisplayTick, replace, replace, setDefaultState, shouldDrawSide, shouldDropItemsOnExplosion, sideCoversSmallSquare, spawnBreakParticles, toString
Methods inherited from class net.minecraft.block.AbstractBlock
calcBlockBreakingDelta, canBucketPlace, canPathfindThrough, canPlaceAt, createCodec, createScreenHandlerFactory, createSettingsCodec, emitsRedstonePower, getAmbientOcclusionLightLevel, getCameraCollisionShape, getCollisionShape, getComparatorOutput, getCullingShape, getDefaultMapColor, getDroppedStacks, getFluidState, getHardness, getInsideCollisionShape, getLootTableKey, getMaxHorizontalModelOffset, getOpacity, getRaycastShape, getRenderingSeed, getRenderType, getRequiredFeatures, getSettings, getSidesShape, getSoundGroup, getStateForNeighborUpdate, getStrongRedstonePower, getTranslationKey, getVerticalModelOffsetMultiplier, getWeakRedstonePower, hasComparatorOutput, hasRandomTicks, hasSidedTransparency, isShapeFullCube, isSideInvisible, isTransparent, mirror, neighborUpdate, onBlockBreakStart, onEntityCollision, onExploded, onProjectileHit, onStacksDropped, onStateReplaced, onSyncedBlockEvent, onUse, onUseWithItem, prepare, rotate, scheduledTick
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.resource.featuretoggle.ToggleableFeature
isEnabled
-
Field Details
-
CODEC
- Mappings:
Namespace Name Mixin selector named CODEC
Lnet/minecraft/block/TurtleEggBlock;CODEC:Lcom/mojang/serialization/MapCodec;
intermediary field_46482
Lnet/minecraft/class_2542;field_46482:Lcom/mojang/serialization/MapCodec;
official a
Ldtg;a:Lcom/mojang/serialization/MapCodec;
-
field_31272
public static final int field_31272- See Also:
- Mappings:
Namespace Name Mixin selector named field_31272
Lnet/minecraft/block/TurtleEggBlock;field_31272:I
intermediary field_31272
Lnet/minecraft/class_2542;field_31272:I
official b
Ldtg;b:I
-
field_31273
public static final int field_31273- See Also:
- Mappings:
Namespace Name Mixin selector named field_31273
Lnet/minecraft/block/TurtleEggBlock;field_31273:I
intermediary field_31273
Lnet/minecraft/class_2542;field_31273:I
official c
Ldtg;c:I
-
field_31274
public static final int field_31274- See Also:
- Mappings:
Namespace Name Mixin selector named field_31274
Lnet/minecraft/block/TurtleEggBlock;field_31274:I
intermediary field_31274
Lnet/minecraft/class_2542;field_31274:I
official d
Ldtg;d:I
-
SMALL_SHAPE
- Mappings:
Namespace Name Mixin selector named SMALL_SHAPE
Lnet/minecraft/block/TurtleEggBlock;SMALL_SHAPE:Lnet/minecraft/util/shape/VoxelShape;
intermediary field_11712
Lnet/minecraft/class_2542;field_11712:Lnet/minecraft/class_265;
official g
Ldtg;g:Lfcr;
-
LARGE_SHAPE
- Mappings:
Namespace Name Mixin selector named LARGE_SHAPE
Lnet/minecraft/block/TurtleEggBlock;LARGE_SHAPE:Lnet/minecraft/util/shape/VoxelShape;
intermediary field_11709
Lnet/minecraft/class_2542;field_11709:Lnet/minecraft/class_265;
official h
Ldtg;h:Lfcr;
-
HATCH
- Mappings:
Namespace Name Mixin selector named HATCH
Lnet/minecraft/block/TurtleEggBlock;HATCH:Lnet/minecraft/state/property/IntProperty;
intermediary field_11711
Lnet/minecraft/class_2542;field_11711:Lnet/minecraft/class_2758;
official e
Ldtg;e:Ldyt;
-
EGGS
- Mappings:
Namespace Name Mixin selector named EGGS
Lnet/minecraft/block/TurtleEggBlock;EGGS:Lnet/minecraft/state/property/IntProperty;
intermediary field_11710
Lnet/minecraft/class_2542;field_11710:Lnet/minecraft/class_2758;
official f
Ldtg;f:Ldyt;
-
-
Constructor Details
-
TurtleEggBlock
- 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>
Ldxt;<init>(Ldxt$d;)V
-
-
Method Details
-
getCodec
- Overrides:
getCodec
in classBlock
- 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
Ldxt;a()Lcom/mojang/serialization/MapCodec;
-
onSteppedOn
Called when an entity steps on this block.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:
onSteppedOn
in classBlock
- Mappings:
Namespace Name Mixin selector named onSteppedOn
Lnet/minecraft/block/Block;onSteppedOn(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Lnet/minecraft/entity/Entity;)V
intermediary method_9591
Lnet/minecraft/class_2248;method_9591(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Lnet/minecraft/class_1297;)V
official a
Ldkl;a(Ldhh;Ljh;Ldxu;Lbvj;)V
-
onLandedUpon
public void onLandedUpon(World world, BlockState state, BlockPos pos, Entity entity, float fallDistance) Called when the entity lands on the block.Default implementation deals fall damage to the entity. Blocks that increase or reduce fall damage (like
HayBlock
) should override this.FarmlandBlock
overrides this method to convert the block to dirt.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:
onLandedUpon
in classBlock
- Mappings:
Namespace Name Mixin selector named onLandedUpon
Lnet/minecraft/block/Block;onLandedUpon(Lnet/minecraft/world/World;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/Entity;F)V
intermediary method_9554
Lnet/minecraft/class_2248;method_9554(Lnet/minecraft/class_1937;Lnet/minecraft/class_2680;Lnet/minecraft/class_2338;Lnet/minecraft/class_1297;F)V
official a
Ldkl;a(Ldhh;Ldxu;Ljh;Lbvj;F)V
-
tryBreakEgg
private void tryBreakEgg(World world, BlockState state, BlockPos pos, Entity entity, int inverseChance) - Mappings:
Namespace Name Mixin selector named tryBreakEgg
Lnet/minecraft/block/TurtleEggBlock;tryBreakEgg(Lnet/minecraft/world/World;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/Entity;I)V
intermediary method_10834
Lnet/minecraft/class_2542;method_10834(Lnet/minecraft/class_1937;Lnet/minecraft/class_2680;Lnet/minecraft/class_2338;Lnet/minecraft/class_1297;I)V
official a
Ldtg;a(Ldhh;Ldxu;Ljh;Lbvj;I)V
-
breakEgg
- Mappings:
Namespace Name Mixin selector named breakEgg
Lnet/minecraft/block/TurtleEggBlock;breakEgg(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
intermediary method_10833
Lnet/minecraft/class_2542;method_10833(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
official a
Ldtg;a(Ldhh;Ljh;Ldxu;)V
-
randomTick
Called server-side when a block gets ticked randomly. This can be overridden to implement various logics, most commonly plant growth. Default implementation does nothing. To control the rate of the action, userandom
.Random tick speed is controlled by the game rule
randomTickSpeed
and can be disabled. Only blocks within 128-block cylinder (i.e. ignoring Y coordinates) around players receive random ticks.Blocks overriding this must use
AbstractBlock.Settings.ticksRandomly()
block settings.Here are some examples:
SugarCaneBlock
uses this to grow sugar cane.OxidizableBlock
uses this to oxidize.NetherPortalBlock
uses this to spawn zombified piglins.LeavesBlock
uses this to decay when far from logs.
- Overrides:
randomTick
in classAbstractBlock
- See Also:
- Mappings:
Namespace Name Mixin selector named randomTick
Lnet/minecraft/block/AbstractBlock;randomTick(Lnet/minecraft/block/BlockState;Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/random/Random;)V
intermediary method_9514
Lnet/minecraft/class_4970;method_9514(Lnet/minecraft/class_2680;Lnet/minecraft/class_3218;Lnet/minecraft/class_2338;Lnet/minecraft/class_5819;)V
official b
Ldxt;b(Ldxu;Lash;Ljh;Lbam;)V
-
isSandBelow
- Mappings:
Namespace Name Mixin selector named isSandBelow
Lnet/minecraft/block/TurtleEggBlock;isSandBelow(Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;)Z
intermediary method_10831
Lnet/minecraft/class_2542;method_10831(Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;)Z
official a
Ldtg;a(Ldgm;Ljh;)Z
-
isSand
- Mappings:
Namespace Name Mixin selector named isSand
Lnet/minecraft/block/TurtleEggBlock;isSand(Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;)Z
intermediary method_29952
Lnet/minecraft/class_2542;method_29952(Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;)Z
official b
Ldtg;b(Ldgm;Ljh;)Z
-
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.world.WorldView, net.minecraft.world.tick.ScheduledTickView, net.minecraft.util.math.BlockPos, net.minecraft.util.math.Direction, net.minecraft.util.math.BlockPos, net.minecraft.block.BlockState, net.minecraft.util.math.random.Random)
orAbstractBlock.neighborUpdate(net.minecraft.block.BlockState, net.minecraft.world.World, net.minecraft.util.math.BlockPos, net.minecraft.block.Block, net.minecraft.world.block.WireOrientation, boolean)
should also be overridden. The method is used in the following cases:- When activating a redstone component on placement (used along with
AbstractBlock.neighborUpdate(net.minecraft.block.BlockState, net.minecraft.world.World, net.minecraft.util.math.BlockPos, net.minecraft.block.Block, net.minecraft.world.block.WireOrientation, 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
Ldxt;b(Ldxu;Ldhh;Ljh;Ldxu;Z)V
- When activating a redstone component on placement (used along with
-
shouldHatchProgress
- Mappings:
Namespace Name Mixin selector named shouldHatchProgress
Lnet/minecraft/block/TurtleEggBlock;shouldHatchProgress(Lnet/minecraft/world/World;)Z
intermediary method_10832
Lnet/minecraft/class_2542;method_10832(Lnet/minecraft/class_1937;)Z
official a
Ldtg;a(Ldhh;)Z
-
afterBreak
public void afterBreak(World world, PlayerEntity player, BlockPos pos, BlockState state, @Nullable @Nullable BlockEntity blockEntity, ItemStack tool) Called server-side when the block is broken by the player using correct tool. This is called afterBlock.onBroken(net.minecraft.world.WorldAccess, net.minecraft.util.math.BlockPos, net.minecraft.block.BlockState)
but has the tool requirement. By default, this incrementsStats.MINED
, adds exhaustion to the player, and drops the block's item stacks.Subclasses should override this if breaking the block causes another block to be placed (like
IceBlock
) or if the block can break multiple times (likeTurtleEggBlock
).BeehiveBlock
uses this to anger the bees if the hive is mined without silk touch.- Overrides:
afterBreak
in classBlock
- See Also:
- Mappings:
Namespace Name Mixin selector named afterBreak
Lnet/minecraft/block/Block;afterBreak(Lnet/minecraft/world/World;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Lnet/minecraft/block/entity/BlockEntity;Lnet/minecraft/item/ItemStack;)V
intermediary method_9556
Lnet/minecraft/class_2248;method_9556(Lnet/minecraft/class_1937;Lnet/minecraft/class_1657;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Lnet/minecraft/class_2586;Lnet/minecraft/class_1799;)V
official a
Ldkl;a(Ldhh;Lcpw;Ljh;Ldxu;Lduw;Lcxo;)V
-
canReplace
Returns whether the item can replace the block.By default, this checks if the block allows replacing and whether the item differs from the block's item. Items composed of multiple blocks, such as candles, vines, or snow layers, should override this to implement additional checks.
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:
canReplace
in classAbstractBlock
- Returns:
- whether the item can replace the block
- See Also:
- Mappings:
Namespace Name Mixin selector named canReplace
Lnet/minecraft/block/AbstractBlock;canReplace(Lnet/minecraft/block/BlockState;Lnet/minecraft/item/ItemPlacementContext;)Z
intermediary method_9616
Lnet/minecraft/class_4970;method_9616(Lnet/minecraft/class_2680;Lnet/minecraft/class_1750;)Z
official a
Ldxt;a(Ldxu;Ldbf;)Z
-
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
Ldkl;a(Ldbf;)Ldxu;
-
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
Ldxt;a(Ldxu;Ldgm;Ljh;Lfcc;)Lfcr;
-
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
Ldkl;a(Ldxv$a;)V
-
breaksEgg
- Mappings:
Namespace Name Mixin selector named breaksEgg
Lnet/minecraft/block/TurtleEggBlock;breaksEgg(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/Entity;)Z
intermediary method_10835
Lnet/minecraft/class_2542;method_10835(Lnet/minecraft/class_3218;Lnet/minecraft/class_1297;)Z
official a
Ldtg;a(Lash;Lbvj;)Z
-