Class DeactivatedEnchantingTableBlock
java.lang.Object
net.minecraft.world.level.block.state.BlockBehaviour
net.minecraft.world.level.block.Block
johnsmith.enchantingoverhauled.block.DeactivatedEnchantingTableBlock
- All Implemented Interfaces:
net.fabricmc.fabric.api.block.v1.FabricBlock,net.minecraft.world.flag.FeatureElement,net.minecraft.world.level.ItemLike
public class DeactivatedEnchantingTableBlock
extends net.minecraft.world.level.block.Block
A block representing an inactive or disturbed Enchanting Table.
This block serves two main purposes:
- Activation Ritual: Players must right-click this block with an
EnchantedTometo transform it into a functional vanillaEnchantingTableBlock. This process triggers visual effects (lightning, particles) and grants an advancement. - Punishment: If a player attempts to activate the table with a standard book or
standard enchanted book, the table rejects it violently, causing an explosion and dealing
ARCANE_RETRIBUTIONdamage.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.level.block.Block
net.minecraft.world.level.block.Block.UpdateFlagsNested classes/interfaces inherited from class net.minecraft.world.level.block.state.BlockBehaviour
net.minecraft.world.level.block.state.BlockBehaviour.BlockStateBase, net.minecraft.world.level.block.state.BlockBehaviour.OffsetFunction, net.minecraft.world.level.block.state.BlockBehaviour.OffsetType, net.minecraft.world.level.block.state.BlockBehaviour.Properties, net.minecraft.world.level.block.state.BlockBehaviour.StateArgumentPredicate<A>, net.minecraft.world.level.block.state.BlockBehaviour.StatePredicate -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringprotected static final net.minecraft.world.phys.shapes.VoxelShapeThe bounding box for the block, matching the vanilla Enchanting Table shape (12 pixels high).Fields inherited from class net.minecraft.world.level.block.Block
BLOCK_STATE_REGISTRY, CODEC, INDESTRUCTIBLE, INSTANT, stateDefinition, UPDATE_ALL, UPDATE_ALL_IMMEDIATE, UPDATE_CLIENTS, UPDATE_IMMEDIATE, UPDATE_INVISIBLE, UPDATE_KNOWN_SHAPE, UPDATE_LIMIT, UPDATE_MOVE_BY_PISTON, UPDATE_NEIGHBORS, UPDATE_NONE, UPDATE_SKIP_ALL_SIDEEFFECTS, UPDATE_SKIP_BLOCK_ENTITY_SIDEEFFECTS, UPDATE_SKIP_ON_PLACE, UPDATE_SKIP_SHAPE_UPDATE_ON_WIRE, UPDATE_SUPPRESS_DROPSFields inherited from class net.minecraft.world.level.block.state.BlockBehaviour
descriptionId, drops, dynamicShape, explosionResistance, friction, hasCollision, isRandomlyTicking, jumpFactor, properties, requiredFeatures, soundType, speedFactor, UPDATE_SHAPE_ORDERFields inherited from interface net.minecraft.world.flag.FeatureElement
FILTERED_REGISTRIES -
Constructor Summary
ConstructorsConstructorDescriptionDeactivatedEnchantingTableBlock(net.minecraft.world.level.block.state.BlockBehaviour.Properties properties) Constructs a new DeactivatedEnchantingTableBlock. -
Method Summary
Modifier and TypeMethodDescriptionprotected @NotNull net.minecraft.world.level.block.RenderShapegetRenderShape(@NotNull net.minecraft.world.level.block.state.BlockState blockState) protected @NotNull net.minecraft.world.phys.shapes.VoxelShapegetShape(@NotNull net.minecraft.world.level.block.state.BlockState blockState, @NotNull net.minecraft.world.level.BlockGetter blockGetter, @NotNull net.minecraft.core.BlockPos pos, @NotNull net.minecraft.world.phys.shapes.CollisionContext context) protected @NotNull net.minecraft.world.InteractionResultuseWithoutItem(@NotNull net.minecraft.world.level.block.state.BlockState blockState, @NotNull net.minecraft.world.level.Level level, @NotNull net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player, @NotNull net.minecraft.world.phys.BlockHitResult hit) Handles the activation logic when the player right-clicks the block.Methods inherited from class net.minecraft.world.level.block.Block
animateTick, asBlock, asItem, box, boxes, boxZ, boxZ, boxZ, builtInRegistryHolder, byItem, canSupportCenter, canSupportRigidBlock, codec, column, column, createBlockStateDefinition, cube, cube, defaultBlockState, destroy, dropFromBlockInteractLootTable, dropFromExplosion, dropFromLootTable, dropResources, dropResources, dropResources, fallOn, getDrops, getDrops, getExplosionResistance, getFriction, getId, getJumpFactor, getName, getShapeForEachState, getShapeForEachState, getSpeedFactor, getStateDefinition, getStateForPlacement, handlePrecipitation, hasDynamicShape, isExceptionForConnection, isFaceFull, isPossibleToRespawnInThis, isShapeFullBlock, playerDestroy, playerWillDestroy, popExperience, popResource, popResourceFromFace, pushEntitiesUp, registerDefaultState, setPlacedBy, shouldRenderFace, spawnDestroyParticles, stateById, stepOn, toString, tryDropExperience, updateEntityMovementAfterFallOn, updateFromNeighbourShapes, updateOrDestroy, updateOrDestroy, wasExploded, withPropertiesOfMethods inherited from class net.minecraft.world.level.block.state.BlockBehaviour
affectNeighborsAfterRemoval, attack, canBeReplaced, canBeReplaced, canSurvive, defaultDestroyTime, defaultMapColor, entityInside, getAnalogOutputSignal, getBlockSupportShape, getCloneItemStack, getCollisionShape, getDescriptionId, getDestroyProgress, getDirectSignal, getDrops, getEntityInsideCollisionShape, getFluidState, getInteractionShape, getLightBlock, getLootTable, getMaxHorizontalOffset, getMaxVerticalOffset, getMenuProvider, getOcclusionShape, getSeed, getShadeBrightness, getSignal, getSoundType, getVisualShape, hasAnalogOutputSignal, isCollisionShapeFullBlock, isPathfindable, isRandomlyTicking, isSignalSource, mirror, neighborChanged, onExplosionHit, onPlace, onProjectileHit, propagatesSkylightDown, properties, propertiesCodec, randomTick, requiredFeatures, rotate, shouldChangedStateKeepBlockEntity, simpleCodec, skipRendering, spawnAfterBreak, tick, triggerEvent, updateIndirectNeighbourShapes, updateShape, useItemOn, useShapeForLightOcclusionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.fabricmc.fabric.api.block.v1.FabricBlock
getAppearanceMethods inherited from interface net.minecraft.world.flag.FeatureElement
isEnabled
-
Field Details
-
DEACTIVATED
- See Also:
-
DISTURBED
- See Also:
-
SHAPE
protected static final net.minecraft.world.phys.shapes.VoxelShape SHAPEThe bounding box for the block, matching the vanilla Enchanting Table shape (12 pixels high).
-
-
Constructor Details
-
DeactivatedEnchantingTableBlock
public DeactivatedEnchantingTableBlock(net.minecraft.world.level.block.state.BlockBehaviour.Properties properties) Constructs a new DeactivatedEnchantingTableBlock.- Parameters:
properties- The block properties.
-
-
Method Details
-
getShape
@NotNull protected @NotNull net.minecraft.world.phys.shapes.VoxelShape getShape(@NotNull @NotNull net.minecraft.world.level.block.state.BlockState blockState, @NotNull @NotNull net.minecraft.world.level.BlockGetter blockGetter, @NotNull @NotNull net.minecraft.core.BlockPos pos, @NotNull @NotNull net.minecraft.world.phys.shapes.CollisionContext context) - Overrides:
getShapein classnet.minecraft.world.level.block.state.BlockBehaviour
-
getRenderShape
@NotNull protected @NotNull net.minecraft.world.level.block.RenderShape getRenderShape(@NotNull @NotNull net.minecraft.world.level.block.state.BlockState blockState) - Overrides:
getRenderShapein classnet.minecraft.world.level.block.state.BlockBehaviour
-
useWithoutItem
@NotNull protected @NotNull net.minecraft.world.InteractionResult useWithoutItem(@NotNull @NotNull net.minecraft.world.level.block.state.BlockState blockState, @NotNull @NotNull net.minecraft.world.level.Level level, @NotNull @NotNull net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player, @NotNull @NotNull net.minecraft.world.phys.BlockHitResult hit) Handles the activation logic when the player right-clicks the block.- Overrides:
useWithoutItemin classnet.minecraft.world.level.block.state.BlockBehaviour- Parameters:
blockState- The current state of the block.level- The level the block is in.pos- The position of the block.player- The player interacting with the block.hit- The hit result of the interaction.- Returns:
InteractionResult.SUCCESSif activated,InteractionResult.CONSUMEif punished, orInteractionResult.PASS.
-