TileEntity.TileEntityPrototype
Hierarchy
- Scriptable
- TileEntityPrototype
Index
Properties
optionalclick
Called when player uses some item on a TileEntity.
Type declaration
Parameters
id: number
count: number
data: number
coords: ItemUseCoordinates
player: number
extra: ItemExtraData
Returns boolean | void
optionalclient
Client tile entity prototype copy.
optionalcontainerEvents
Events of the container on the server side.
Type declaration
[eventName string]: (packetData: any, connectedClient: NetworkClient) => void
Example of the server container event function.
optionalcreated
optionaldefaultValues
Default data values, will be initially added to TileEntity.data field.
optionaldestroy
Occurs when the TileEntity is being destroyed.
Type declaration
Parameters
fromDestroyBlock: boolean
isDropAllowed: boolean
Returns boolean | void
optionaldestroyBlock
Occurs when a block of the TileEntity is being destroyed. See Callback.DestroyBlockFunction for details.
Type declaration
Parameters
coords: ItemUseCoordinates
player: number
Returns void
optionalevents
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.
optionalgetGuiScreen
Called to get the UI.IWindow object for the current TileEntity. The window is then opened within TileEntity.container when the player clicks it.
Client-side method only.
Type declaration
Returns IWindow
optionalgetScreenByName
Called on client side, returns the window to open.
Type declaration
Parameters
optionalscreenName: string
optionalcontainer: ItemContainer
Returns IWindow
optionalgetScreenName
Called on server side and returns UI name to open on click.
Type declaration
Parameters
player: number
coords: ItemUseCoordinates
Returns string
optionalinit
optionalloadsince: 2.0.2b29
Called when the client copy is created.
Type declaration
Returns void
optionalonCheckerTicksince: 2.0.2b29
Called before every tile ticking to remove them.
Type declaration
Parameters
isInitialized: boolean
isLoaded: boolean
wasLoaded: boolean
Returns void
optionalonConnectionPlayersince: 2.3.1b116-3
Called when player connects to server.
Type declaration
Parameters
client: NetworkClient
connected player client
Returns void
optionalonDisconnectionPlayersince: 2.3.1b116-3
Called when player disconnects from server.
Type declaration
Parameters
client: NetworkClient
disconnected player client
Returns void
optionalprojectileHit
Occurs when a projectile entity hits the TileEntity. See Callback.ProjectileHitFunction for details.
Type declaration
Parameters
coords: ItemUseCoordinates
target: ProjectileHitTarget
Returns void
optionalredstone
Occurs when the TileEntity should handle redstone signal. See Callback.RedstoneSignalFunction for details.
Type declaration
Parameters
params: RedstoneSignalParams
Returns void
optionalrequireMoreLiquid
Called when more liquid is required.
Type declaration
Parameters
liquid: string
amount: number
Returns void
optionaltick
Called every tick and should be used for all the updates of the TileEntity.
Type declaration
Returns void
optionalunloadsince: 2.0.2b29
Called on destroying the client copy.
Type declaration
Returns void
optionaluseNetworkItemContainer
Use ItemContainer that supports multiplayer.
Interface passed to TileEntity.registerPrototype function.