Class CommandBlock

All Implemented Interfaces:
BlockEntityProvider, OperatorBlock, ItemConvertible

public class CommandBlock extends BlockWithEntity implements OperatorBlock
Mappings:
Namespace Name
official caq
intermediary net/minecraft/class_2288
named net/minecraft/block/CommandBlock
  • Field Details

    • LOGGER

      private static final Logger LOGGER
      Mappings:
      Namespace Name Mixin selector
      official c Lcaq;c:Lorg/apache/logging/log4j/Logger;
      intermediary field_10792 Lnet/minecraft/class_2288;field_10792:Lorg/apache/logging/log4j/Logger;
      named LOGGER Lnet/minecraft/block/CommandBlock;LOGGER:Lorg/apache/logging/log4j/Logger;
    • FACING

      public static final DirectionProperty FACING
      Mappings:
      Namespace Name Mixin selector
      official a Lcaq;a:Lclm;
      intermediary field_10791 Lnet/minecraft/class_2288;field_10791:Lnet/minecraft/class_2753;
      named FACING Lnet/minecraft/block/CommandBlock;FACING:Lnet/minecraft/state/property/DirectionProperty;
    • CONDITIONAL

      public static final BooleanProperty CONDITIONAL
      Mappings:
      Namespace Name Mixin selector
      official b Lcaq;b:Lclj;
      intermediary field_10793 Lnet/minecraft/class_2288;field_10793:Lnet/minecraft/class_2746;
      named CONDITIONAL Lnet/minecraft/block/CommandBlock;CONDITIONAL:Lnet/minecraft/state/property/BooleanProperty;
    • auto

      private final boolean auto
      Mappings:
      Namespace Name Mixin selector
      official d Lcaq;d:Z
      intermediary field_27192 Lnet/minecraft/class_2288;field_27192:Z
      named auto Lnet/minecraft/block/CommandBlock;auto:Z
  • Constructor Details

    • CommandBlock

      public CommandBlock(AbstractBlock.Settings settings, boolean auto)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lcaq;<init>(Lckr$c;Z)V
      intermediary <init> Lnet/minecraft/class_2288;<init>(Lnet/minecraft/class_4970$class_2251;Z)V
      named <init> Lnet/minecraft/block/CommandBlock;<init>(Lnet/minecraft/block/AbstractBlock$Settings;Z)V
  • Method Details

    • createBlockEntity

      public BlockEntity createBlockEntity(BlockPos pos, BlockState state)
      Specified by:
      createBlockEntity in interface BlockEntityProvider
      Mappings:
      Namespace Name Mixin selector
      official a Lcbv;a(Lgg;Lcks;)Lcip;
      intermediary method_10123 Lnet/minecraft/class_2343;method_10123(Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)Lnet/minecraft/class_2586;
      named createBlockEntity Lnet/minecraft/block/BlockEntityProvider;createBlockEntity(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Lnet/minecraft/block/entity/BlockEntity;
    • neighborUpdate

      public void neighborUpdate(BlockState state, World world, BlockPos pos, Block block, BlockPos fromPos, boolean notify)
      Overrides:
      neighborUpdate in class AbstractBlock
      Mappings:
      Namespace Name Mixin selector
      official a Lckr;a(Lcks;Lbwp;Lgg;Lbzo;Lgg;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
      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
    • scheduledTick

      public void scheduledTick(BlockState state, ServerWorld world, BlockPos pos, Random random)
      Overrides:
      scheduledTick in class AbstractBlock
      Mappings:
      Namespace Name Mixin selector
      official a Lckr;a(Lcks;Labr;Lgg;Ljava/util/Random;)V
      intermediary method_9588 Lnet/minecraft/class_4970;method_9588(Lnet/minecraft/class_2680;Lnet/minecraft/class_3218;Lnet/minecraft/class_2338;Ljava/util/Random;)V
      named scheduledTick Lnet/minecraft/block/AbstractBlock;scheduledTick(Lnet/minecraft/block/BlockState;Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/util/math/BlockPos;Ljava/util/Random;)V
    • execute

      private void execute(BlockState state, World world, BlockPos pos, CommandBlockExecutor executor, boolean hasCommand)
      Mappings:
      Namespace Name Mixin selector
      official a Lcaq;a(Lcks;Lbwp;Lgg;Lbvp;Z)V
      intermediary method_9780 Lnet/minecraft/class_2288;method_9780(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_1918;Z)V
      named execute Lnet/minecraft/block/CommandBlock;execute(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/world/CommandBlockExecutor;Z)V
    • 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:
      onUse in class AbstractBlock
      Returns:
      an action result that specifies if using the block was successful.
      Mappings:
      Namespace Name Mixin selector
      official a Lckr;a(Lcks;Lbwp;Lgg;Lbkd;Larz;Ldmw;)Lasa;
      intermediary method_9534 Lnet/minecraft/class_4970;method_9534(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_1657;Lnet/minecraft/class_1268;Lnet/minecraft/class_3965;)Lnet/minecraft/class_1269;
      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/Hand;Lnet/minecraft/util/hit/BlockHitResult;)Lnet/minecraft/util/ActionResult;
    • hasComparatorOutput

      public boolean hasComparatorOutput(BlockState state)
      Overrides:
      hasComparatorOutput in class AbstractBlock
      Mappings:
      Namespace Name Mixin selector
      official d_ Lckr;d_(Lcks;)Z
      intermediary method_9498 Lnet/minecraft/class_4970;method_9498(Lnet/minecraft/class_2680;)Z
      named hasComparatorOutput Lnet/minecraft/block/AbstractBlock;hasComparatorOutput(Lnet/minecraft/block/BlockState;)Z
    • getComparatorOutput

      public int getComparatorOutput(BlockState state, World world, BlockPos pos)
      Overrides:
      getComparatorOutput in class AbstractBlock
      Mappings:
      Namespace Name Mixin selector
      official a Lckr;a(Lcks;Lbwp;Lgg;)I
      intermediary method_9572 Lnet/minecraft/class_4970;method_9572(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;)I
      named getComparatorOutput Lnet/minecraft/block/AbstractBlock;getComparatorOutput(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)I
    • onPlaced

      public void onPlaced(World world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack itemStack)
      Overrides:
      onPlaced in class Block
      Mappings:
      Namespace Name Mixin selector
      official a Lbzo;a(Lbwp;Lgg;Lcks;Latt;Lbqp;)V
      intermediary method_9567 Lnet/minecraft/class_2248;method_9567(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Lnet/minecraft/class_1309;Lnet/minecraft/class_1799;)V
      named onPlaced Lnet/minecraft/block/Block;onPlaced(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/item/ItemStack;)V
    • getRenderType

      public BlockRenderType getRenderType(BlockState state)
      Overrides:
      getRenderType in class BlockWithEntity
      Mappings:
      Namespace Name Mixin selector
      official b_ Lckr;b_(Lcks;)Lcfd;
      intermediary method_9604 Lnet/minecraft/class_4970;method_9604(Lnet/minecraft/class_2680;)Lnet/minecraft/class_2464;
      named getRenderType Lnet/minecraft/block/AbstractBlock;getRenderType(Lnet/minecraft/block/BlockState;)Lnet/minecraft/block/BlockRenderType;
    • rotate

      public BlockState rotate(BlockState state, BlockRotation rotation)
      Applies a block rotation to a block state.

      By default, this returns the provided block state.

      Overrides:
      rotate in class AbstractBlock
      Returns:
      the rotated block state
      Mappings:
      Namespace Name Mixin selector
      official a Lckr;a(Lcks;Lcfk;)Lcks;
      intermediary method_9598 Lnet/minecraft/class_4970;method_9598(Lnet/minecraft/class_2680;Lnet/minecraft/class_2470;)Lnet/minecraft/class_2680;
      named rotate Lnet/minecraft/block/AbstractBlock;rotate(Lnet/minecraft/block/BlockState;Lnet/minecraft/util/BlockRotation;)Lnet/minecraft/block/BlockState;
    • mirror

      public BlockState mirror(BlockState state, BlockMirror mirror)
      Overrides:
      mirror in class AbstractBlock
      Mappings:
      Namespace Name Mixin selector
      official a Lckr;a(Lcks;Lcdx;)Lcks;
      intermediary method_9569 Lnet/minecraft/class_4970;method_9569(Lnet/minecraft/class_2680;Lnet/minecraft/class_2415;)Lnet/minecraft/class_2680;
      named mirror Lnet/minecraft/block/AbstractBlock;mirror(Lnet/minecraft/block/BlockState;Lnet/minecraft/util/BlockMirror;)Lnet/minecraft/block/BlockState;
    • appendProperties

      protected void appendProperties(StateManager.Builder<Block,​BlockState> builder)
      Overrides:
      appendProperties in class Block
      Mappings:
      Namespace Name Mixin selector
      official a Lbzo;a(Lckt$a;)V
      intermediary method_9515 Lnet/minecraft/class_2248;method_9515(Lnet/minecraft/class_2689$class_2690;)V
      named appendProperties Lnet/minecraft/block/Block;appendProperties(Lnet/minecraft/state/StateManager$Builder;)V
    • getPlacementState

      public BlockState getPlacementState(ItemPlacementContext ctx)
      Overrides:
      getPlacementState in class Block
      Mappings:
      Namespace Name Mixin selector
      official a Lbzo;a(Lbsp;)Lcks;
      intermediary method_9605 Lnet/minecraft/class_2248;method_9605(Lnet/minecraft/class_1750;)Lnet/minecraft/class_2680;
      named getPlacementState Lnet/minecraft/block/Block;getPlacementState(Lnet/minecraft/item/ItemPlacementContext;)Lnet/minecraft/block/BlockState;
    • executeCommandChain

      private static void executeCommandChain(World world, BlockPos pos, Direction facing)
      Mappings:
      Namespace Name Mixin selector
      official a Lcaq;a(Lbwp;Lgg;Lgl;)V
      intermediary method_9779 Lnet/minecraft/class_2288;method_9779(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2350;)V
      named executeCommandChain Lnet/minecraft/block/CommandBlock;executeCommandChain(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/Direction;)V