Optional
data: anyOptional
func: FunctionOptional
cancelFunc: Functionchange the block at position position
to blockType
and blockData
this will not change the block for the user himself. It is mainly useful when a user places a block and only needs to send it to other players on the server
change the block at position position
to blockType
and blockData
this will not change the block for the user himself. It is mainly useful when a user places a block and only needs to send it to other players on the server
The world object which the player is in (use serv.overworld, serv.netherworld, serv.endworld, or a custom world). Options:
The world object which the player is in (use serv.overworld, serv.netherworld, serv.endworld, or a custom world). Options:
sends message
to the player
sends message
to the player
Optional
deathHow much time before an entity despawns (in ms)
Number from 0 to 1.0 representing the progress bar at the bottom of the player's screen. Set this with player.setDisplayXp()
Numerical type of the entity.
Decreases velocity when touching blocks
Gets object that stores data, personalized per plugin. Returns null if plugin does not exist.
Shortcut for: entity.pluginData[pluginName];
Gets object that stores data, personalized per plugin. Returns null if plugin does not exist.
Shortcut for: entity.pluginData[pluginName];
Gets all entities nearby (within entity.viewDistance)
Gets all entities nearby (within entity.viewDistance)
Gets all nearby players regardless of what client thinks
Gets all nearby players regardless of what client thinks
Optional
radius: numberGets every player other than self (all players if entity is not a player)
Gets every player other than self (all players if entity is not a player)
Get every other entity other than self Should not be used repeatedly as it is a slow operation
Get every other entity other than self Should not be used repeatedly as it is a slow operation
Gravity of entity (non-players) to calculate physics.
handle command
handle command
Pitch of entity's head
ID of entity on server
Optional
itemIf a block drop, what item damage
Optional
itemIf a block drop, what item id
kicks player with reason
kicks player with reason
Optional
reason: stringlogin
login
Metadata for the entity (not like block metadata/damage). Contains stuff like NBT.
Optional
nameSub-category of entity. For mobs, this is which mob (Zombie/Skeleton, etc). For objects, this is which object (Arrow/Dropped item, etc)
List of entities that the entity believes is nearby.
Gets all nearby players that client can see
Gets all nearby players that client can see
Optional
radius: numberOptional
pickupHow long before an entity can be picked up (in ms)
Pitch of entity (rotation sideways)
Easy way to only play a sound for one player. Same opt as serv.playSound except no whitelist
.
Easy way to only play a sound for one player. Same opt as serv.playSound except no whitelist
.
Optional
opt: {}Current position (currently in fixed position (x32 what you'd expect) so do entity.position.scaled(1/32) to get normal position)
If worldFolder
option is set, save player's data into <worldFolder>/playerdata/<UUID>.dat
. Returns promise.
Example: save all players data to disk:
for (const player of serv.players) {
player.save()
}
If worldFolder
option is set, save player's data into <worldFolder>/playerdata/<UUID>.dat
. Returns promise.
Example: save all players data to disk:
for (const player of serv.players) {
player.save()
}
change the block at position position
to blockType
and blockData
this will not make any changes on the server's world and only sends it to the user as a "fake" or "local" block
change the block at position position
to blockType
and blockData
this will not make any changes on the server's world and only sends it to the user as a "fake" or "local" block
Set the block action at position position
to actionId
and actionParam
.
blockType
is only required when the block at the location is a fake block.
This will only be caused by using player.sendBlock
.
This will not make any changes to the server's world and only sends it to the user as a local action.
Set the block action at position position
to actionId
and actionParam
.
blockType
is only required when the block at the location is a fake block.
This will only be caused by using player.sendBlock
.
This will not make any changes to the server's world and only sends it to the user as a local action.
Send the specified brand
to the player or flying-squid
by default
Send the specified brand
to the player or flying-squid
by default
Optional
brand: stringUpdates the player's xp based on player.xp, player.displayXp, and player.xpLevel
Updates the player's xp based on player.xp, player.displayXp, and player.xpLevel
Saves block in world and sends block update to all players of the same world.
Saves block in world and sends block update to all players of the same world.
Sets a block action and sends the block action to all players in the same world.
This will not make any changes to the server's world
Sets a block action and sends the block action to all players in the same world.
This will not make any changes to the server's world
Sets and sends the player's new display amount. num should be from 0 to 1.0
Sets and sends the player's new display amount. num should be from 0 to 1.0
set player gameMode to gameMode
set player gameMode to gameMode
Sets the player's XP level. Options:
Sets the player's XP level. Options:
Optional
__namedParameters: { Optional
send?: booleanOptional
setOptional
setSets and sends the player's new level
Sets and sends the player's new level
Used to calculate collisions for server-side entities
Either serv.spawnPoint or randomly selected for each player. Possibly could be overridden in future (e.g. beds or anchors), serv global serv.spawnPoint should as fallback
sound: Sound to play (default is game.player.hurt)
sound: Sound to play (default is game.player.hurt)
Optional
animation?: booleanOptional
damage?: numberOptional
maxOptional
sound?: stringOptional
velocity?: anyOnly applies to gravity, really. You can still apply a velocity larger than terminal velocity.
Either "player", "mob", or "object" (currently)
Updates the player's food and sends the relevant packet.
Updates the player's food and sends the relevant packet.
Updates the player's food saturation and sends the relevant packet.
Updates the player's food saturation and sends the relevant packet.
Updates the player's health and sends the relevant packet.
Updates the player's health and sends the relevant packet.
The username of the player
The view size of the player, for example 8 for 16x16
How far away entities are loaded/unloaded (used for players ATM)
Total experience the player has (int). Set this using player.setXp()
Level of xp the player has. Set this with player.setXpLevel()
Yaw of entity (rotation looking up and down)
Optional
[captureGenerated using TypeDoc
When an entity was born. Used with pickupTime and deathTime (time in epoch)