Interface IForgeBlockEntity

All Superinterfaces:
ICapabilityProvider, ICapabilitySerializable<CompoundTag>, INBTSerializable<CompoundTag>
All Known Implementing Classes:
AbstractFurnaceBlockEntity, BannerBlockEntity, BarrelBlockEntity, BaseContainerBlockEntity, BeaconBlockEntity, BedBlockEntity, BeehiveBlockEntity, BellBlockEntity, BlastFurnaceBlockEntity, BlockEntity, BlockEntityOnLoadTest.TestBlockEntity, BrewingStandBlockEntity, CampfireBlockEntity, ChestBlockEntity, CommandBlockEntity, ComparatorBlockEntity, ConduitBlockEntity, CustomHeadTest.CustomSkullBlockEntity, CustomSignsTest.CustomSignBlockEntity, CustomTransformTypeTest.ItemHangerBlockEntity, DaylightDetectorBlockEntity, DispenserBlockEntity, DropperBlockEntity, EnchantmentTableBlockEntity, EnderChestBlockEntity, FluidHandlerBlockEntity, FullPotsAccessorDemo.DioriteFlowerPotBlockEntity, FurnaceBlockEntity, GameTestTest.EnergyBlockEntity, HopperBlockEntity, JigsawBlockEntity, JukeboxBlockEntity, LecternBlockEntity, MegaModelTest.TestBlock.Entity, PistonMovingBlockEntity, RandomizableContainerBlockEntity, SculkCatalystBlockEntity, SculkSensorBlockEntity, SculkShriekerBlockEntity, ShulkerBoxBlockEntity, SignBlockEntity, SkullBlockEntity, SmokerBlockEntity, SpawnerBlockEntity, StructureBlockEntity, TheEndGatewayBlockEntity, TheEndPortalBlockEntity, TrappedChestBlockEntity

public interface IForgeBlockEntity extends ICapabilitySerializable<CompoundTag>
  • Field Details

    • INFINITE_EXTENT_AABB

      static final AABB INFINITE_EXTENT_AABB
      Sometimes default render bounding box: infinite in scope. Used to control rendering on BlockEntityWithoutLevelRenderer.
  • Method Details

    • self

      private BlockEntity self()
    • deserializeNBT

      default void deserializeNBT(CompoundTag nbt)
      Specified by:
      deserializeNBT in interface INBTSerializable<CompoundTag>
    • serializeNBT

      default CompoundTag serializeNBT()
      Specified by:
      serializeNBT in interface INBTSerializable<CompoundTag>
    • onDataPacket

      default void onDataPacket(Connection net, ClientboundBlockEntityDataPacket pkt)
      Called when you receive a TileEntityData packet for the location this TileEntity is currently in. On the client, the NetworkManager will always be the remote server. On the server, it will be whomever is responsible for sending the packet.
      Parameters:
      net - The NetworkManager the packet originated from
      pkt - The data packet
    • handleUpdateTag

      default void handleUpdateTag(CompoundTag tag)
      Called when the chunk's TE update tag, gotten from BlockEntity.getUpdateTag(), is received on the client.

      Used to handle this tag in a special way. By default this simply calls BlockEntity.load(CompoundTag).

      Parameters:
      tag - The CompoundTag sent from BlockEntity.getUpdateTag()
    • getPersistentData

      CompoundTag getPersistentData()
      Gets a CompoundTag that can be used to store custom data for this block entity. It will be written, and read from disc, so it persists over world saves.
      Returns:
      A compound tag for custom persistent data
    • onChunkUnloaded

      default void onChunkUnloaded()
    • onLoad

      default void onLoad()
      Called when this is first added to the world (by LevelChunk.addAndRegisterBlockEntity(BlockEntity)) or right before the first tick when the chunk is generated or loaded from disk. Override instead of adding if (firstTick) stuff in update.
    • getRenderBoundingBox

      default AABB getRenderBoundingBox()
      Return an AABB that controls the visible scope of a BlockEntityWithoutLevelRenderer associated with this BlockEntity Defaults to the collision bounding box BlockBehaviour.BlockStateBase.getCollisionShape(BlockGetter, BlockPos) associated with the block at this location.
      Returns:
      an appropriately size AABB for the BlockEntity
    • requestModelDataUpdate

      default void requestModelDataUpdate()
      Requests a refresh for the model data of your TE Call this every time your getModelData() changes
    • getModelData

      @NotNull default @NotNull ModelData getModelData()
      Allows you to return additional model data. This data can be used to provide additional functionality in your BakedModel You need to schedule a refresh of you model data via requestModelDataUpdate() if the result of this function changes. Note that this method may be called on a chunk render thread instead of the main client thread
      Returns:
      Your model data
    • hasCustomOutlineRendering

      default boolean hasCustomOutlineRendering(Player player)
      Returns whether this BlockEntity has custom outline rendering behavior.
      Parameters:
      player - the local player currently viewing this BlockEntity
      Returns:
      true to enable outline processing