Denovo

Actions

Change something in the game.

send [Player] the message [text]

send Player the message 0

Sends the player a chat message. Only that player sees it.

SlotTakesWhat it is for
1PlayerThe player to send the message to.
2textThe text to send.

Script: player.sendMessage(text)

Paper javadoc

teleport [Player] to [Location]

teleport Player to Location

Teleports this entity to the given location. If this entity is riding a vehicle, it will be dismounted prior to teleportation.

SlotTakesWhat it is for
1PlayerThe Player to act on.
2LocationNew location to teleport this entity to

Script: player.teleport(location)

Paper javadoc

set health of [Player] to [number]

set health of Player to 0

Sets the entity's health from 0 to getMaxHealth(), where 0 is dead.

SlotTakesWhat it is for
1PlayerThe Player to act on.
2numberNew health represented from 0 to max

Script: player.setHealth(number)

Paper javadoc

set food level of [Player] to [number]

set food level of Player to 0

Sets the players current food level

SlotTakesWhat it is for
1PlayerThe Player to act on.
2numberNew food level

Script: player.setFoodLevel(number)

Paper javadoc

set [Player] on fire for [number] ticks

set Player on fire for 0 ticks

Sets the entity's current fire ticks (ticks before the entity stops being on fire).

SlotTakesWhat it is for
1PlayerThe Player to act on.
2numberCurrent ticks remaining

Script: player.setFireTicks(number)

Paper javadoc

give [Player] [number] experience

give Player 0 experience

Gives the player the amount of experience specified.

SlotTakesWhat it is for
1PlayerThe Player to act on.
2numberExp amount to give

Script: player.giveExp(number)

Paper javadoc

kick [Player] with reason [text]

kick Player with reason 0

Disconnects the player from the server, showing them the given reason on their disconnect screen.

SlotTakesWhat it is for
1PlayerThe player to disconnect.
2textThe reason shown to them.

Script: player.kickPlayer(text)

Paper javadoc

play sound [Sound] to [Player] at [Location] · volume [number] · pitch [number]

play sound Sound to Player at Location · volume 0 · pitch 0

Play a sound for a player at the location. This function will fail silently if Location or Sound are null.

SlotTakesWhat it is for
1SoundThe sound to play
2PlayerThe Player to act on.
3LocationThe location to play the sound
4numberThe volume of the sound
5numberThe pitch of the sound

Script: player.playSound(location, sound, number, number)

Paper javadoc

set game mode of [Player] to [GameMode]

set game mode of Player to GameMode

Sets this human's current GameMode

SlotTakesWhat it is for
1PlayerThe Player to act on.
2GameModeNew game mode

Script: player.setGameMode(gameMode)

Paper javadoc

play sound [Sound] to [Player] at [Location] in category [SoundCategory] · volume [number] · pitch [number]

play sound Sound to Player at Location in category SoundCategory · volume 0 · pitch 0

Play a sound for a player at the location. This function will fail silently if Location or Sound are null.

SlotTakesWhat it is for
1SoundThe sound to play
2PlayerThe Player to act on.
3LocationThe location to play the sound
4SoundCategoryThe category of the sound
5numberThe volume of the sound
6numberThe pitch of the sound

Script: player.playSound(location, sound, soundCategory, number, number)

Paper javadoc

in [World] spawn [EntityType] at [Location]

in World spawn EntityType at Location

Creates a entity at the given Location

SlotTakesWhat it is for
1WorldThe World to act on.
2EntityTypeThe entity to spawn
3LocationThe location to spawn the entity

Script: world.spawnEntity(location, entityType)

Paper javadoc

in [World] show [Particle] particles at [Location] · count [number]

in World show Particle particles at Location · count 0

Spawns the particle (the number of times specified by count) at the target location.

SlotTakesWhat it is for
1WorldThe World to act on.
2Particlethe particle to spawn
3Locationthe location to spawn at
4numberthe number of particles

Script: world.spawnParticle(particle, location, number)

Paper javadoc

in [World] strike lightning at [Location]

in World strike lightning at Location

Strikes lightning at the given Location

SlotTakesWhat it is for
1WorldThe World to act on.
2LocationThe location to strike lightning

Script: world.strikeLightning(location)

Paper javadoc

set block [Block] to [Material]

set block Block to Material

Sets the type of this block

SlotTakesWhat it is for
1BlockThe Block to act on.
2MaterialMaterial to change this block to

Script: block.setType(material)

Paper javadoc

give [Player] [number] of item [Material]

give Player 0 of item Material

Puts items straight into the player's inventory. Anything that does not fit is discarded rather than dropped on the ground, so check for space first if that matters. An amount below 1 is treated as 1.

SlotTakesWhat it is for
1PlayerThe player to give the items to.
2numberHow many. Amounts over a stack fill several slots.
3MaterialWhich item to give.

Script: player.giveItem(material, number)

give [Player] effect [PotionEffectType] for [number] ticks at level [number]

give Player effect PotionEffectType for 0 ticks at level 0

Applies a potion effect to the player for a while. Replaces any effect of the same kind already running.

SlotTakesWhat it is for
1PlayerThe player to affect.
2PotionEffectTypeWhich effect to apply.
3numberHow long it lasts, in ticks. 20 ticks is one second.
4numberStrength, counting from 0 -- level 0 is what the game shows as I, level 1 as II.

Script: player.giveEffect(potionEffectType, number, number)

set attribute [Attribute] of [Player] to [number]

set attribute Attribute of Player to 0

Sets one of the player's underlying attributes, such as max health or movement speed. Does nothing at all if that attribute does not apply to players, so a change that appears to have no effect usually means the wrong attribute was chosen.

SlotTakesWhat it is for
1AttributeWhich attribute to set.
2PlayerThe player to change.
3numberThe new base value, before any modifiers the game applies on top.

Script: player.setAttributeBase(attribute, number)

enchant [Player]'s held item with [Enchantment] level [number]

enchant Player's held item with Enchantment level 0

Enchants whatever the player is holding in their main hand. Does nothing if the hand is empty. Vanilla level limits are not enforced, so levels beyond the normal maximum are allowed and the item keeps them.

SlotTakesWhat it is for
1PlayerThe player whose held item to enchant.
2EnchantmentWhich enchantment to add.
3numberThe level, counting from 1.

Script: player.enchantHeldItem(enchantment, number)

equip [Player]'s [EquipmentSlot] with [Material]

equip Player's EquipmentSlot with Material

Puts an item in one of the player's equipment slots, replacing whatever was there. The replaced item is not returned to the player, so it is gone.

SlotTakesWhat it is for
1PlayerThe player to equip.
2EquipmentSlotWhich slot to fill -- head, chest, legs, feet, or a hand.
3MaterialThe item to put in the slot.

Script: player.setEquipment(equipmentSlot, material)

send [Player] a [NamedTextColor] message [text]

send Player a NamedTextColor message 0

Sends the player a chat message in one colour. Only that player sees it.

SlotTakesWhat it is for
1PlayerThe player to send the message to.
2NamedTextColorThe colour of the message.
3textThe text to send.

Script: player.sendColoredMessage(namedTextColor, text)

On this page