Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface TileEntityPrototype

Interface passed to TileEntity.registerPrototype function

Hierarchy

  • TileEntityPrototype

Indexable

[key: string]: any

Any other user-defined methods and properties

Index

Properties

Optional click

click: (id: number, count: number, data: number, coords: ItemUseCoordinates, player: number, extra: ItemExtraData) => boolean | void

Called when player uses some item on a TileEntity

returns

true if the event is handled and should not be propagated to the next handlers. E.g. return true if you don't want the user interface to be opened

Type declaration

Optional client

client: { containerEvents?: {}; events?: {}; load?: () => void; tick?: () => void; unload?: () => void }

Client TileEntity prototype copy

Type declaration

  • [key: string]: any

    Any other user-defined methods and properties

  • Optional containerEvents?: {}

    Events of the container's client copy

  • Optional events?: {}

    Events that receive packets on the client side

    • [packetName: string]: (packetData: any, packetExtra: any) => void

      Example of the client packet event function

        • (packetData: any, packetExtra: any): void
        • Parameters

          • packetData: any
          • packetExtra: any

          Returns void

  • Optional load?: () => void

    Called when the client copy is created

      • (): void
      • Returns void

  • Optional tick?: () => void

    Called every tick on client thread

      • (): void
      • Returns void

  • Optional unload?: () => void

    Called on destroying the client copy

      • (): void
      • Returns void

Optional containerEvents

containerEvents: {}

Events of the container on the server side

Type declaration

Optional created

created: () => void

Called when a TileEntity is created

Type declaration

    • (): void
    • Returns void

Optional defaultValues

defaultValues: {}

Default data values, will be initially added to TileEntity.data field

Type declaration

  • [key: string]: any

Optional destroy

destroy: () => boolean | void

Occurs when the TileEntity is being destroyed

returns

true to prevent TileEntity object from destroying (but if the block was destroyed, returning true from this function doesn't replace the missing block with a new one)

Type declaration

    • (): boolean | void
    • Returns boolean | void

Optional destroyBlock

destroyBlock: (coords: ItemUseCoordinates, player: number) => void

Occurs when a block of the TileEntity is being destroyed. See Callback.DestroyBlockFunction for details

Type declaration

Optional events

events: {}

Events that receive packets on the server side

Type declaration

  • [packetName: string]: (packetData: any, packetExtra: any, connectedClient: NetworkClient) => void

    Example of the server packet event function. 'this.sendResponse' method is only available here.

      • (packetData: any, packetExtra: any, connectedClient: NetworkClient): void
      • Parameters

        • packetData: any
        • packetExtra: any
        • connectedClient: NetworkClient

        Returns void

Optional getGuiScreen

getGuiScreen: () => IWindow

Called to get the UI.IWindow object for the current TileEntity. The window is then opened within TileEntity.container when the player clicks it

deprecated

Don't use in multiplayer

Type declaration

Optional getScreenByName

getScreenByName: (screenName?: string) => Window | StandartWindow | StandardWindow | TabbedWindow

Called on client side, returns the window to open

Type declaration

Optional getScreenName

getScreenName: (player: number, coords: Vector) => string

Called on server side and returns UI name to open on click

Type declaration

    • (player: number, coords: Vector): string
    • Parameters

      • player: number
      • coords: Vector

      Returns string

Optional init

init: () => void

Called when a TileEntity is initialised in the world

Type declaration

    • (): void
    • Returns void

Optional projectileHit

projectileHit: (coords: ItemUseCoordinates, target: ProjectileHitTarget) => void

Occurs when a projectile entity hits the TileEntity. See Callback.ProjectileHitFunction for details

Type declaration

Optional redstone

redstone: (params: { onLoad: boolean; power: number; signal: number }) => void

Occurs when the TileEntity should handle redstone signal. See Callback.RedstoneSignalFunction for details

Type declaration

    • (params: { onLoad: boolean; power: number; signal: number }): void
    • Parameters

      • params: { onLoad: boolean; power: number; signal: number }
        • onLoad: boolean
        • power: number
        • signal: number

      Returns void

Optional requireMoreLiquid

requireMoreLiquid: (liquid: string, amount: number) => void

Called when more liquid is required

Type declaration

    • (liquid: string, amount: number): void
    • Parameters

      • liquid: string
      • amount: number

      Returns void

Optional tick

tick: () => void

Called every tick and should be used for all the updates of the TileEntity

Type declaration

    • (): void
    • Returns void

Optional useNetworkItemContainer

useNetworkItemContainer: boolean

Use ItemContainer that supports multiplayer

Generated using TypeDoc