Class BlockEntityBehaviourEvent

java.lang.Object
net.neoforged.bus.api.Event
com.simibubi.create.api.event.BlockEntityBehaviourEvent

public class BlockEntityBehaviourEvent extends net.neoforged.bus.api.Event
Event that is fired just before a SmartBlockEntity is being deserialized
Also if a new one is placed
Use it to attach a new BlockEntityBehaviour or replace existing ones (with caution)

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

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

Example:
 
 		neoForgeEventBus.addListener((BlockEntityBehaviourEvent event) -> {
 			event.forType(AllBlockEntityTypes.FUNNEL.get(), be -> {
 				event.attach(new FunFunnelBehaviour(be));
 			});
 		});