Class PylonEntity


  • 
    public abstract class PylonEntity<E extends Entity>
    
                        

    Represents a Pylon entity in the world.

    All custom Pylon entities extend this class. Every instance of this class is wrapping a real entity in the world, and is stored in EntityStorage. All new block types must be registered using register, and all new Pylon entities must be added to EntityStorage with EntityStorage.add.

    You are responsible for creating your Pylon entities; there are no place constructors as with Pylon blocks. This is because it doesn't make sense for Pylon to manage spawning entities. However, your entity must still have a load constructor that takes a single parameter of type E.

    • Constructor Detail

      • PylonEntity

        PylonEntity(E entity)
    • Method Detail

      • getWaila

         WailaDisplay getWaila(Player player)

        WAILA is the text that shows up when looking at a block to tell you what the block is. It can also be used for entities.

        This will only be called for the player if the player has WAILA enabled.

        Returns:

        the WAILA configuration, or null if WAILA should not be shown for this block.

      • writeDebugInfo

         void writeDebugInfo(PersistentDataContainer pdc)

        Called when debug info is requested for the entity by someone using the DebugWaxedWeatheredCutCopperStairs. If there is any transient data that can be useful for debugging, you're encouraged to save it here.

        Defaults to a normal write call.

      • write

         void write(PersistentDataContainer pdc)

        Called when the entity is saved.

        Put any logic to save the data in the entity here.

        Do not assume that when this is called, the entity is being unloaded. This may be called for other reasons, such as when a player right clicks with DebugWaxedWeatheredCutCopperStairs

      • getSettings

         final Config getSettings()

        Returns settings associated with the block.

        Shorthand for Settings.get(getKey())