Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface passed to TileEntity.registerPrototype function

Hierarchy

Indexable

[key: string]: any

Any other user-defined methods and properties

Index

Properties

client?: { containerEvents?: {}; events?: {}; load?: any; tick?: any; unload?: any }

Client TileEntity prototype copy

Type declaration

containerEvents?: {}

Events of the container on the server side

Type declaration

defaultValues?: {}

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

Type declaration

  • [key: string]: any
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
      • Example of the server packet event function. 'this.sendResponse' method is only available here.

        Parameters

        Returns void

useNetworkItemContainer?: boolean

Use ItemContainer that supports multiplayer

Methods

  • Called when player uses some item on a TileEntity

    Parameters

    Returns boolean | void

    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

  • created(): void
  • destroy(): boolean | void
  • Occurs when the TileEntity is being destroyed

    Returns boolean | void

    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)

  • getScreenName(player: number, coords: Vector): string
  • Called on server side and returns UI name to open on click

    Parameters

    Returns string

  • init(): void
  • redstone(params: { onLoad: boolean; power: number; signal: number }): void
  • requireMoreLiquid(liquid: string, amount: number): void
  • Called when more liquid is required

    Parameters

    • liquid: string
    • amount: number

    Returns void

  • tick(): void

Generated using TypeDoc