Class TileEntityBehaviourEvent<T extends SmartTileEntity>

java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.GenericEvent<T>
com.simibubi.create.api.event.TileEntityBehaviourEvent<T>
All Implemented Interfaces:
net.minecraftforge.eventbus.api.IGenericEvent<T>

public class TileEntityBehaviourEvent<T extends SmartTileEntity> extends net.minecraftforge.eventbus.api.GenericEvent<T>
Event that is fired just before a SmartTileEntity is being deserialized
Also if a new one is placed
Use it to attach a new TileEntityBehaviour or replace existing ones (with caution)

Actual setup of the behaviours internal workings and data should be done in TileEntityBehaviour#read() and TileEntityBehaviour#initialize() respectively.

Because of the earliness of this event, the added behaviours will have access to the initial NBT read (unless the TE was placed, not loaded), thereby allowing tiles to store and retrieve data for injected behaviours.
  • Constructor Details

  • Method Details

    • getGenericType

      public Type getGenericType()
      Specified by:
      getGenericType in interface net.minecraftforge.eventbus.api.IGenericEvent<T extends SmartTileEntity>
      Overrides:
      getGenericType in class net.minecraftforge.eventbus.api.GenericEvent<T extends SmartTileEntity>
    • attach

      public void attach(TileEntityBehaviour behaviour)
    • remove

      public TileEntityBehaviour remove(BehaviourType<?> type)
    • getTileEntity

      public T getTileEntity()
    • getBlockState

      public net.minecraft.world.level.block.state.BlockState getBlockState()