TileEntity
Hierarchy
- TileEntityPrototype
- TileEntity
Index
Properties
- blockID
- blockSource
- click
- client
- container
- containerEvents
- created
- data
- defaultValues
- destroy
- destroyBlock
- dimension
- events
- getGuiScreen
- getScreenByName
- getScreenName
- init
- isLoaded
- liquidStorage
- load
- networkData
- networkEntity
- networkEntityType
- networkEntityTypeName
- noupdate
- onCheckerTick
- onConnectionPlayer
- onDisconnectionPlayer
- onItemClick
- projectileHit
- redstone
- remove
- requireMoreLiquid
- selfDestroy
- sendPacket
- sendResponse
- tick
- unload
- update
- useNetworkItemContainer
- x
- y
- z
Properties
readonlyblockID
Block ID of tile.
blockSource
BlockSource object to manipulate tile position in world.
click
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.
container
Tile item container.
optionalcontainerEvents
Events of the container on the server side.
Type declaration
[eventName string]: (container: ItemContainer, window: UI.Window | UI.StandartWindow | UI.StandardWindow | UI.TabbedWindow | null, windowContent: UI.WindowContent | null, eventData: any) => void
Example of the server container event function.
created
data
Tile data values object.
defaultValues
Default data values, will be initially added to TileEntity.data field.
destroy
Occurs when the TileEntity is being destroyed.
Type declaration
Parameters
fromDestroyBlock: boolean
isDropAllowed: boolean
Returns boolean | void
destroyBlock
Occurs when a block of the TileEntity is being destroyed. See Callback.DestroyBlockFunction for details.
Type declaration
Parameters
coords: ItemUseCoordinates
player: number
Returns void
readonlydimension
Dimension where the tile is located.
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.
getGuiScreen
Called to get the UI.IWindow object for the current TileEntity. The window is then opened within TileEntity.container when the player clicks it.
Type declaration
Returns IWindow
getScreenByName
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: Vector
Returns string
init
isLoaded
true
if tile is loaded in the world.
liquidStorage
Tile liquid storage.
load
Called when the client copy is created.
Type declaration
Returns void
readonlynetworkData
SyncedNetworkData object of the tile.
readonlynetworkEntity
Instance of TileEntity.networkEntityType for the tile.
readonlynetworkEntityType
NetworkEntityType object of the tile.
readonlynetworkEntityTypeName
noupdate
true
if tile cannot tick, update functions will
not work in that case.
onCheckerTick
Called before every tile ticking to remove them.
Type declaration
Parameters
isInitialized: boolean
isLoaded: boolean
wasLoaded: boolean
Returns void
optionalonConnectionPlayer
Called when player connects to server.
Type declaration
Parameters
client: NetworkClient
connected player client
Returns void
optionalonDisconnectionPlayer
Called when player disconnects from server.
Type declaration
Parameters
client: NetworkClient
disconnected player client
Returns void
onItemClick
Emulates click on this tile, calling TileEntity.TileEntityPrototype.click or opening screen otherwise if window has present.
Type declaration
Parameters
id: number
count: number
data: number
coords: ItemUseCoordinates
player: number
extra: ItemExtraData
Returns boolean | void
projectileHit
Occurs when a projectile entity hits the TileEntity. See Callback.ProjectileHitFunction for details.
Type declaration
Parameters
coords: ItemUseCoordinates
target: ProjectileHitTarget
Returns void
redstone
Occurs when the TileEntity should handle redstone signal. See Callback.RedstoneSignalFunction for details.
Type declaration
Parameters
params: RedstoneSignalParams
Returns void
remove
true
if tile has been destroyed.
requireMoreLiquid
Called when more liquid is required.
Type declaration
Parameters
liquid: string
amount: number
Returns void
selfDestroy
Destroys the tile prototype.
Type declaration
Returns void
sendPacket
Sends the packet from server to all clients.
Type declaration
Parameters
name: string
data: object
Returns void
sendResponse
Sends packet to specified client.
Type declaration
Parameters
packetName: string
someData: object
Returns void
optionaltick
Called every tick and should be used for all the updates of the TileEntity.
Type declaration
Returns void
unload
Called on destroying the client copy.
Type declaration
Returns void
update
Called every tick to TileEntity.TileEntityPrototype.tick each tile if TileEntity.noupdate not active.
Type declaration
Returns void
optionaluseNetworkItemContainer
Use ItemContainer that supports multiplayer.
readonlyx
X coord of the tile in it's dimension.
readonlyy
Y coord of the tile in it's dimension.
readonlyz
Z coord of the tile in it's dimension.
Interface passed to TileEntity.registerPrototype function.