Package net.minecraft.block
Class RespawnAnchorBlock
java.lang.Object
net.minecraft.block.AbstractBlock
net.minecraft.block.Block
net.minecraft.block.RespawnAnchorBlock
- All Implemented Interfaces:
ItemConvertible
public class RespawnAnchorBlock 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 IntPropertyCHARGESprivate static ImmutableList<Vec3i>VALID_HORIZONTAL_SPAWN_OFFSETSprivate static ImmutableList<Vec3i>VALID_SPAWN_OFFSETSFields 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 RespawnAnchorBlock(AbstractBlock.Settings settings) -
Method Summary
Modifier and Type Method Description protected voidappendProperties(StateManager.Builder<Block,BlockState> builder)private static booleancanCharge(BlockState state)booleancanPathfindThrough(BlockState state, BlockView world, BlockPos pos, NavigationType type)static voidcharge(World world, BlockPos pos, BlockState state)private voidexplode(BlockState state, World world, BlockPos explodedPos)static Optional<Vec3d>findRespawnPosition(EntityType<?> entity, CollisionView world, BlockPos pos)private static Optional<Vec3d>findRespawnPosition(EntityType<?> entity, CollisionView world, BlockPos pos, boolean bool)intgetComparatorOutput(BlockState state, World world, BlockPos pos)static intgetLightLevel(BlockState state, int maxLevel)booleanhasComparatorOutput(BlockState state)private static booleanhasStillWater(BlockPos pos, World world)private static booleanisChargeItem(ItemStack stack)static booleanisNether(World world)ActionResultonUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit)Called when this block is used by a player.voidrandomDisplayTick(BlockState state, World world, BlockPos pos, Random random)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, onBreak, onBroken, onDestroyedByExplosion, onEntityLand, onLandedUpon, onPlaced, onSteppedOn, postProcessState, precipitationTick, pushEntitiesUpBeforeBlockChange, replace, replace, setDefaultState, shouldDrawSide, shouldDropItemsOnExplosion, sideCoversSmallSquare, toStringMethods inherited from class net.minecraft.block.AbstractBlock
calcBlockBreakingDelta, canBucketPlace, canPlaceAt, canReplace, createScreenHandlerFactory, emitsRedstonePower, getAmbientOcclusionLightLevel, getCollisionShape, getCullingShape, getDefaultMapColor, getDroppedStacks, getFluidState, getLootTableId, getMaxModelOffset, getOffsetType, getOpacity, getOutlineShape, getPistonBehavior, getRaycastShape, getRenderingSeed, getRenderType, getSidesShape, getStateForNeighborUpdate, getStrongRedstonePower, getVisualShape, getWeakRedstonePower, hasSidedTransparency, isSideInvisible, mirror, neighborUpdate, onBlockAdded, onBlockBreakStart, onEntityCollision, onProjectileHit, onStacksDropped, onStateReplaced, onSyncedBlockEvent, prepare, randomTick, rotate, scheduledTick
-
Field Details
-
CHARGES
-
VALID_HORIZONTAL_SPAWN_OFFSETS
-
VALID_SPAWN_OFFSETS
-
-
Constructor Details
-
RespawnAnchorBlock
-
-
Method Details
-
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.
-
isChargeItem
-
canCharge
-
hasStillWater
-
explode
-
isNether
-
charge
-
randomDisplayTick
@Environment(CLIENT) public void randomDisplayTick(BlockState state, World world, BlockPos pos, Random random)- Overrides:
randomDisplayTickin classBlock
-
appendProperties
- Overrides:
appendPropertiesin classBlock
-
hasComparatorOutput
- Overrides:
hasComparatorOutputin classAbstractBlock
-
getLightLevel
-
getComparatorOutput
- Overrides:
getComparatorOutputin classAbstractBlock
-
findRespawnPosition
public static Optional<Vec3d> findRespawnPosition(EntityType<?> entity, CollisionView world, BlockPos pos) -
findRespawnPosition
private static Optional<Vec3d> findRespawnPosition(EntityType<?> entity, CollisionView world, BlockPos pos, boolean bool)
-