Class TrialSpawnerBlock

All Implemented Interfaces:
BlockEntityProvider, ItemConvertible, ToggleableFeature

public class TrialSpawnerBlock extends BlockWithEntity
Mappings:
Namespace Name
official dfe
intermediary net/minecraft/class_8960
named net/minecraft/block/TrialSpawnerBlock
  • Field Details

    • CODEC

      public static final com.mojang.serialization.MapCodec<TrialSpawnerBlock> CODEC
      Mappings:
      Namespace Name Mixin selector
      official a Ldfe;a:Lcom/mojang/serialization/MapCodec;
      intermediary field_47348 Lnet/minecraft/class_8960;field_47348:Lcom/mojang/serialization/MapCodec;
      named CODEC Lnet/minecraft/block/TrialSpawnerBlock;CODEC:Lcom/mojang/serialization/MapCodec;
    • TRIAL_SPAWNER_STATE

      public static final EnumProperty<TrialSpawnerState> TRIAL_SPAWNER_STATE
      Mappings:
      Namespace Name Mixin selector
      official b Ldfe;b:Ldkf;
      intermediary field_47349 Lnet/minecraft/class_8960;field_47349:Lnet/minecraft/class_2754;
      named TRIAL_SPAWNER_STATE Lnet/minecraft/block/TrialSpawnerBlock;TRIAL_SPAWNER_STATE:Lnet/minecraft/state/property/EnumProperty;
  • Constructor Details

    • TrialSpawnerBlock

      public TrialSpawnerBlock(AbstractBlock.Settings settings)
      Mappings:
      Namespace Name Mixin selector
      official <init> Ldjg;<init>(Ldjg$d;)V
      intermediary <init> Lnet/minecraft/class_4970;<init>(Lnet/minecraft/class_4970$class_2251;)V
      named <init> Lnet/minecraft/block/AbstractBlock;<init>(Lnet/minecraft/block/AbstractBlock$Settings;)V
  • Method Details

    • getCodec

      public com.mojang.serialization.MapCodec<TrialSpawnerBlock> getCodec()
      Specified by:
      getCodec in class BlockWithEntity
      Mappings:
      Namespace Name Mixin selector
      official a Ldjg;a()Lcom/mojang/serialization/MapCodec;
      intermediary method_53969 Lnet/minecraft/class_4970;method_53969()Lcom/mojang/serialization/MapCodec;
      named getCodec Lnet/minecraft/block/AbstractBlock;getCodec()Lcom/mojang/serialization/MapCodec;
    • appendProperties

      protected void appendProperties(StateManager.Builder<Block,BlockState> builder)
      Appends block state properties to this block. To use this, override and call StateManager.Builder.add(net.minecraft.state.property.Property<?>[]) inside the method. See Properties for the list of pre-defined properties.
      Overrides:
      appendProperties in class Block
      Mappings:
      Namespace Name Mixin selector
      official a Lcwq;a(Ldji$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
    • getRenderType

      public BlockRenderType getRenderType(BlockState state)
      Returns the block's render type (invisible, animated, model).
      Overrides:
      getRenderType in class BlockWithEntity
      Returns:
      the block's render type (invisible, animated, model)
      Mappings:
      Namespace Name Mixin selector
      official b_ Ldjg;b_(Ldjh;)Ldcv;
      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;
    • createBlockEntity

      @Nullable public @Nullable BlockEntity createBlockEntity(BlockPos pos, BlockState state)
      Returns a new block entity instance.

      For example:

      
       @Override
       public BlockEntity createBlockEntity(BlockPos pos, BlockState state) {
         return new MyBlockEntity(pos, state);
       }
       
      Returns:
      a new block entity instance
      Mappings:
      Namespace Name Mixin selector
      official a Lczi;a(Lhx;Ldjh;)Ldgv;
      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;
    • getTicker

      @Nullable public <T extends BlockEntity> @Nullable BlockEntityTicker<T> getTicker(World world, BlockState state, BlockEntityType<T> type)
      Returns the "ticker" for the block's block entity, or null if the block entity does not need to be ticked.

      Ticker is a functional interface called every tick to tick the block entity on both the client and the server.

      Tickers should validate that the passed type is the one this block expects, and return null if it isn't. This is to prevent crashes in rare cases where a mismatch occurs between the position's block and block entity. BlockWithEntity.validateTicker(net.minecraft.block.entity.BlockEntityType<A>, net.minecraft.block.entity.BlockEntityType<E>, net.minecraft.block.entity.BlockEntityTicker<? super E>) can be used to implement the check.

      Example:

      
       public <T extends BlockEntity> BlockEntityTicker<T> getTicker(World world, BlockState state, BlockEntityType<T> type) {
         if (type != YourMod.MY_BLOCK_ENTITY_TYPE) return null;
         // This should be a static method usable as a BlockEntityTicker.
         return YourBlockEntity::tick;
       }
       
      Returns:
      the "ticker" for the block's block entity, or null if the block entity does not need to be ticked
      Mappings:
      Namespace Name Mixin selector
      official a Lczi;a(Lctp;Ldjh;Ldgx;)Ldgw;
      intermediary method_31645 Lnet/minecraft/class_2343;method_31645(Lnet/minecraft/class_1937;Lnet/minecraft/class_2680;Lnet/minecraft/class_2591;)Lnet/minecraft/class_5558;
      named getTicker Lnet/minecraft/block/BlockEntityProvider;getTicker(Lnet/minecraft/world/World;Lnet/minecraft/block/BlockState;Lnet/minecraft/block/entity/BlockEntityType;)Lnet/minecraft/block/entity/BlockEntityTicker;
    • appendTooltip

      public void appendTooltip(ItemStack stack, @Nullable @Nullable BlockView world, List<Text> tooltip, TooltipContext options)
      Appends tooltips to a stack of this block's corresponding block item. Used by shulker boxes.
      Overrides:
      appendTooltip in class Block
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official a Lcwq;a(Lcmy;Lcsv;Ljava/util/List;Lcoq;)V
      intermediary method_9568 Lnet/minecraft/class_2248;method_9568(Lnet/minecraft/class_1799;Lnet/minecraft/class_1922;Ljava/util/List;Lnet/minecraft/class_1836;)V
      named appendTooltip Lnet/minecraft/block/Block;appendTooltip(Lnet/minecraft/item/ItemStack;Lnet/minecraft/world/BlockView;Ljava/util/List;Lnet/minecraft/client/item/TooltipContext;)V