Ban player given a uuid. If the player is online, using player.ban()
. Bans with reason or You are banned!
.
Optional
reason: stringBans players given a username. Mainly used if player is not online, otherwise use player.ban()
.
Bans players given a username. Mainly used if player is not online, otherwise use player.ban()
.
Object of players that are banned, key is their uuid. Use () getUUIDFromUsername()
if you only have their username.
Example player:
{
time: <time in epoch>,
reason: <reason given>
}
Optional
data: anyOptional
func: FunctionOptional
cancelFunc: FunctionBroadcasts message
to all the players with the optional color
.
Broadcasts message
to all the players with the optional color
.
Optional
opt: { Optional
blacklist?: any[]Optional
system?: booleanOptional
whitelist?: anyCreates the log file
Creates the log file
Default true
. If false, time will not automatically pass.
Emits particle (see id list) at position
in world
.
Opt:
Emits particle (see id list) at position
in world
.
Opt:
Optional
__namedParameters: { Optional
blacklist?: any[]Optional
count?: numberOptional
longOptional
radius?: numberOptional
size?: anyOptional
whitelist?: anyAll of the entities
The current maximum ID (i.e. the last entity that was spawned has that id)
Logs a message
as error
Logs a message
as error
Returns array of players within loc. loc is a required paramater. The object contains:
Returns array of players within loc. loc is a required paramater. The object contains:
Optional
radius?: numberGet pitch. note
should be between 0-24 and your output is from 0.5 to 2.0
Get pitch. note
should be between 0-24 and your output is from 0.5 to 2.0
Returns player object with that username or, if no such player is on the server, null.
Returns player object with that username or, if no such player is on the server, null.
Gets UUID from username. Since it needs to fetch from mojang servers, it is not immediate.
Arguments in format: callback(uuid)
. uuid
is null if no such username exists.
Gets UUID from username. Since it needs to fetch from mojang servers, it is not immediate.
Arguments in format: callback(uuid)
. uuid
is null if no such username exists.
Logs a message
as info
Logs a message
as info
Optional
levelParsed level.dat of the loaded world (only if worldFolder is specificed)
Logs a message
Logs a message
Contains the nether world. This WILL be used when a player travels through a portal if they are in the overworld!
Similar to serv.updateBlock
but will trigger an update on the 6 direct neighbors of pos
but not on the block itself.
Similar to serv.updateBlock
but will trigger an update on the 6 direct neighbors of pos
but not on the block itself.
Optional
forceNotify: booleanOptional
data: nullSimilar to serv.updateBlock
but will trigger an update on 5 of the direct neighbors of pos.plus(dir)
, but not on the block at pos
or pos.plus(dir)
.
Similar to serv.updateBlock
but will trigger an update on 5 of the direct neighbors of pos.plus(dir)
, but not on the block at pos
or pos.plus(dir)
.
Optional
forceNotify: booleanOptional
data: nullRegister a handler that will be called when a player interact with a block of type name
.
The argument given to the handler is an object containing the clicked block and the player. It should return true if the block interaction occurred and the block placement should be cancelled.
Register a handler that will be called when a player interact with a block of type name
.
The argument given to the handler is an object containing the clicked block and the player. It should return true if the block interaction occurred and the block placement should be cancelled.
Register a handler that will be called when a block of the type name
is updated. It should verify that the block state is still correct according to the game's rules. It is triggered when a neighboring block has been modified.
The arguments of the handler are the world in which the update occurred, the block, fromTick the tick at which the update was triggered, the tick the update was scheduled to (current tick), and optional data (null most of the time) that can be used to transmit data between block updates. The handler should return true if the block was changed so the update manager can send a multiBlockChange packet for all the changes that occurred within the tick. The state of the block should be modified by using the world's setBlockXXX functions instead of serv.setBlock (that would send redundant updates to players).
Register a handler that will be called when a block of the type name
is updated. It should verify that the block state is still correct according to the game's rules. It is triggered when a neighboring block has been modified.
The arguments of the handler are the world in which the update occurred, the block, fromTick the tick at which the update was triggered, the tick the update was scheduled to (current tick), and optional data (null most of the time) that can be used to transmit data between block updates. The handler should return true if the block was changed so the update manager can send a multiBlockChange packet for all the changes that occurred within the tick. The state of the block should be modified by using the world's setBlockXXX functions instead of serv.setBlock (that would send redundant updates to players).
Register a handler that will be called when an item of type name
is called to place a block.
The argument given to the handler is an object containing the held item that triggered the event, the direction (face) on which the player clicked, the angle of the player around the placed block. It should return an object containing the id and data of the block to place.
Register a handler that will be called when an item of type name
is called to place a block.
The argument given to the handler is an object containing the held item that triggered the event, the direction (face) on which the player clicked, the angle of the player around the placed block. It should return an object containing the id and data of the block to place.
Optional
warn: booleanContains the overworld world. This is where the default spawn point is
Pardons a player given a username.
Pardons a player given a username.
Plays noteblock in world at position. pitch
is from 0-24
Plays noteblock in world at position. pitch
is from 0-24
Optional
__namedParameters: { Optional
instrument?: stringOptional
particle?: booleanPlays sound
(string, google "minecraft sound list") to all players in opt.radius
.
If position is null, will play at the location of every player (taking into account whitelist and blacklist).
Opt:
Plays sound
(string, google "minecraft sound list") to all players in opt.radius
.
If position is null, will play at the location of every player (taking into account whitelist and blacklist).
Opt:
Optional
__namedParameters: { Optional
blacklist?: any[]Optional
pitch?: numberOptional
radius?: numberOptional
soundOptional
volume?: numberOptional
whitelist?: anyAn array of players currently logged in
List of all plugins. Use serv.plugins[pluginName] to get a plugin's object and data.
Returns an array of entities that satisfies the given command selector string str
, execution position pos
, execution world world
, and the ID of the entity that initiated the execution ctxEntityId
.
Valid selector string values are names of online players and valid target selector variables.
Setting allowUser
to true
(default value) enables players to be included in the returned array, disables otherwise.
Returns an array of entities that satisfies the given command selector string str
, execution position pos
, execution world world
, and the ID of the entity that initiated the execution ctxEntityId
.
Valid selector string values are names of online players and valid target selector variables.
Setting allowUser
to true
(default value) enables players to be included in the returned array, disables otherwise.
Optional
pos: Vec3Optional
world: anyOptional
allowUser: booleanOptional
ctxEntityId: anySaves 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.
Sends a block action to all players of the same world.
Sends a block action to all players of the same world.
Resets tick interval to occur ticksPerSecond
times per second.
Use stopTickInterval server.stopTickInterval()
if you want but this method already calls that and you can use serv.doDaylightCycle
to stop it anyway.
Resets tick interval to occur ticksPerSecond
times per second.
Use stopTickInterval server.stopTickInterval()
if you want but this method already calls that and you can use serv.doDaylightCycle
to stop it anyway.
Set daylight cycle time in ticks. See serv.time
for more info.
Set daylight cycle time in ticks. See serv.time
for more info.
Optional
spawnGlobal spawn and respawn point for every player
serv.tabComplete
has types and tab completition function
You can provide your types:
serv.tabComplete.add('tabId', () => {
return ['some', 'values', 'in array', 'ONLY STRINGS!']
})
Optional
otherData: nullOptional
existingContent: stringTotal number of ticks that have passed since the start of the world.
Best to use with modulo (e.g. Something every 10 seconds is serv.tickCount % 20*10 === 0
)
Current daylight cycle time in ticks. Morning is 0, noon is 6000, evening is 12000, and night is 18000.
Resets to 0 at 24000. Use serv.setTime(time)
to set the time.
Trigger a block update for the block in world
at pos
. fromTick
is the current server tick serv.tickCount
, tick
is the future server tick when the update should be executed. When forceNotify
is true, the block update will always trigger an update on the 6 direct neighbors, even when no handler is registered for this block type. data
is an optional object that will be given to the handler.
Trigger a block update for the block in world
at pos
. fromTick
is the current server tick serv.tickCount
, tick
is the future server tick when the update should be executed. When forceNotify
is true, the block update will always trigger an update on the 6 direct neighbors, even when no handler is registered for this block type. data
is an optional object that will be given to the handler.
Optional
forceNotify: booleanOptional
data: nullObject for converting UUIDs to players
Logs a message
as warning
Logs a message
as warning
Generated using TypeDoc
Ban player given a uuid. If the player is online, using
player.ban()
. Bans with reason orYou are banned!
.