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:

  1. Activation Ritual: Players must right-click this block with an EnchantedTome to transform it into a functional vanilla EnchantingTableBlock. This process triggers visual effects (lightning, particles) and grants an advancement.
  2. 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_RETRIBUTION damage.
  • Nested Class Summary

    Nested classes/interfaces inherited from class net.minecraft.world.level.block.Block

    net.minecraft.world.level.block.Block.UpdateFlags

    Nested 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

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
    protected static final net.minecraft.world.phys.shapes.VoxelShape
    The 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_DROPS

    Fields inherited from class net.minecraft.world.level.block.state.BlockBehaviour

    descriptionId, drops, dynamicShape, explosionResistance, friction, hasCollision, isRandomlyTicking, jumpFactor, properties, requiredFeatures, soundType, speedFactor, UPDATE_SHAPE_ORDER

    Fields inherited from interface net.minecraft.world.flag.FeatureElement

    FILTERED_REGISTRIES
  • Constructor Summary

    Constructors
    Constructor
    Description
    DeactivatedEnchantingTableBlock(net.minecraft.world.level.block.state.BlockBehaviour.Properties properties)
    Constructs a new DeactivatedEnchantingTableBlock.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected @NotNull net.minecraft.world.level.block.RenderShape
    getRenderShape(@NotNull net.minecraft.world.level.block.state.BlockState blockState)
     
    protected @NotNull net.minecraft.world.phys.shapes.VoxelShape
    getShape(@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.InteractionResult
    useWithoutItem(@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, withPropertiesOf

    Methods 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, useShapeForLightOcclusion

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface net.fabricmc.fabric.api.block.v1.FabricBlock

    getAppearance

    Methods inherited from interface net.minecraft.world.flag.FeatureElement

    isEnabled
  • Field Details

    • DEACTIVATED

      public static final String DEACTIVATED
      See Also:
    • DISTURBED

      public static final String DISTURBED
      See Also:
    • SHAPE

      protected static final net.minecraft.world.phys.shapes.VoxelShape SHAPE
      The 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:
      getShape in class net.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:
      getRenderShape in class net.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:
      useWithoutItem in class net.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.SUCCESS if activated, InteractionResult.CONSUME if punished, or InteractionResult.PASS.