PylonBlock

constructor(block: Block, context: BlockCreateContext)(source)

This constructor is called when a new block is created in the world.


constructor(block: Block, pdc: PersistentDataContainer)(source)

This constructor is called when the block is loaded. For example, if the server restarts, we need to create a new PylonBlock instance, and we'll do it with this constructor.

You should only load data in this constructor. If you need to do any extra logic on load for whatever reason, it's recommended to do it in postLoad to make sure all data associated with your block that you don't directly control (such as inventories, associated entities, fluid tank data, etc) has been loaded.

See also