Host calls
Host calls
On this page
Everything a plugin can ask the server, grouped as the server's code is. Generated by
tools/gen_api_docs.py from crates/rustmc-plugin/src/host.rs (the Host trait) and
crates/rustmc-plugin-wasm/src/call.rs (what a Wasm guest sends). Do not edit by hand.
264 calls in the Host trait; 264 of them can be made by a Wasm guest.
How a call is made
- A native Rust plugin calls the
Hostmethod on the&dyn Hostit is handed. - A Wasm guest sends
{"call": "<name>", ...fields}through therustmc.callimport and reads back{"ok": <value>}or{"error": "<why>"}(the ABI). An unknown call is anerror, never a trap. With the guest SDK,rustmc_guest::host::call(name, fields)makes any call, andrustmc_guest::hosthas a typed function for most of them (the SDK index). - A parameter named
pluginin a Rust signature is the calling plugin's own name. A Wasm guest never sends it: the server fills it in from the manifest, so a guest can act only as itself.
How values are encoded
| Rust | Wasm JSON |
|---|---|
PlayerId, EntityId | integer. A player's entity id is their player id |
World | string: minecraft:overworld, minecraft:the_nether, minecraft:the_end, or a plugin world's name |
BlockPos | [x, y, z], whole numbers |
Vec3 | [x, y, z], numbers (blocks) |
u128 account id | 32 lower-case hex digits, no dashes (a request may use dashes) |
Option<T> | T, or null |
Result<T, String> | {"ok": T}, or {"error": "..."} |
bool that says whether something happened | true / false; false usually means the player, entity or world has gone |
() | null |
| bytes | as the field's notes say: a list of byte values, hex, or base64 |
text component (&str holding JSON) | the component itself, as a JSON value, not a string |
GameMode | survival, creative, adventure, spectator |
Units: positions are blocks, times are ticks (20 a second) unless a field ends in _ms or
_seconds, angles are degrees (yaw 0 faces south, +z), and health is half-hearts as the game counts it.
Item, block, entity, sound and particle ids that a Wasm request names are passed through the game's rename table, so a plugin built against an older name still works after the game renames it.
What needs the owner's grant
No host call is gated by the manifest. A few reach outside the server and do nothing unless the
server owner granted them in rustmc.yml, or need something else set up:
| Call | Needs |
|---|---|
http_send | a plugin-outbound.<plugin>.<grant> section in rustmc.yml |
net_listen | a plugin-ports.<plugin>.<grant> section in rustmc.yml |
net_unlisten | a plugin-ports grant (see net_listen) |
net_poll | a plugin-ports grant (see net_listen) |
net_send | a plugin-ports grant (see net_listen) |
net_respond | a plugin-ports grant (see net_listen) |
net_close | a plugin-ports grant (see net_listen) |
network_publish | network.enabled in rustmc.yml; a channel outside the plugin's own namespace needs network.channels.<plugin> |
network_subscribe | as network_publish |
network_send | network.enabled, and a network.peers.<peer>.join address in rustmc.yml; the peer needs accepts-transfers=true |
sql_submit | one of the plugin's own secret settings holding the database URL; a setting that is not secret is refused |
sql_result | see sql_submit |
storage_migrate | an operator (level 3) or the console running one of the plugin's own commands at that moment (see the doc comment) |
Many calls act only on what the calling plugin made itself: its creatures, menus, boss bars, reserved blocks, guard zones, per-viewer tab entries, schematics, storage and grants. Each call's doc comment says so where it applies.
Constants
Limits and markers the calls' doc comments name, from crates/rustmc-plugin/src/value.rs and
tab.rs:
| Constant | Value | What |
|---|---|---|
KEEP_CELL | u16::MAX | A cell of Host::write_blocks that is left as it is. |
MAX_BATCH | 1000 | The most entries one batched call takes. |
MAX_BOX_COLUMNS | 16 | The most columns one box of Host::read_blocks reaches: each one read costs the calling thread, and an edit's slices are inside one. |
MAX_BOX_ENTITY_BYTES | 512 * 1024 | The most SNBT one box of Host::read_blocks answers: what a guest can read inside a call's fuel. |
MAX_BULK | 4096 | The most positions one bulk block call -- set_blocks, blocks_are -- takes at once. |
MAX_FAKE_ENTRIES | 80 | The most fake rows one plugin shows one viewer: TAB's layout, four columns of twenty. |
MAX_NEAR_RADIUS | 128.0 | The largest radius entities_in searches, in blocks. |
MAX_NETWORK_PAYLOAD | (1 << 20) - 1024 | The most bytes one network_publish payload may carry: what a link frame holds, less room for the channel and the frame's own header. |
MAX_PUT_MANY | 16_384 | The most rows one storage_put_many carries, across its tables. |
MAX_RECIPE_PAGE | 500 | The most recipes one recipes page holds. |
STORAGE_BUSY | "storage busy" | What a refused storage_put_many starts with when the backend has fallen behind: nothing was kept, and the same rows may be offered again in a moment. |
Groups
| Group | Calls | What |
|---|---|---|
| Players: who is here, visibility and moderation | 19 | Finding players, their identity and client, hiding them, bans, kicks and permission checks. |
| Player state: health, food, experience, mode and movement | 17 | What a player has and is doing, and changing it. |
| Inventory, items and components | 23 | Giving, taking, reading and editing stacks, cooldowns, dropped items and containers. |
| Entities and display entities | 46 | Reading and changing any entity, spawning entities (including per-viewer display entities), riding, and damage. |
| Plugin creatures | 6 | Creatures a plugin spawns, owns and gives orders to. |
| Blocks | 21 | Reading and writing blocks, block entities and whole boxes of blocks, and reserving and guarding blocks. |
| Worlds, time, border, game rules, sound and particles | 18 | Facts about a world as a whole, and effects played in it. |
| Chat and text | 8 | Plain and formatted messages, titles, chat completions and capturing a player's next chat line. |
| Tab list, nametags, sidebar, boss bars and scores | 27 | What each player sees in the tab list, over heads, in the sidebar and in boss bars. |
| Menus (GUI) | 3 | Chest-like screens of buttons that a plugin opens for one player. |
| Packets and plugin channels | 5 | Sending raw packets and plugin-channel messages, and decoding and encoding packet bodies. |
| Resource packs | 3 | Hosting a pack on the server's own pack host, and sending packs to players. |
| Storage | 16 | A plugin's own key-value bytes, its storage tables, and SQL on an external database. |
| Settings and disabled systems | 3 | The plugin's own settings, as the web portal edits them, and which vanilla systems it switched off. |
| The plugin bus | 3 | Calling another plugin, publishing news, and asking whether a plugin is running. |
| Outbound HTTP and plugin ports | 9 | Fetching from the web, sending to an owner-granted URL, and listening on an owner-granted port. |
| The server network: cross-server messages, presence and hopping | 7 | Publishing to the other servers network in rustmc.yml links, hearing them, who is on each, and sending players across. |
| Web map and chunk pre-generation | 6 | Drawing the web map, its markers, and queueing chunks to be generated ahead of players. |
| Schematics | 10 | Loading and saving schematic files in the plugin's own folder. |
| Recipes | 2 | The recipes the server has loaded, datapack ones included, as vanilla recipe JSON. |
| The server: time, logging, health, restarts and cryptography | 12 | The server clock, the log, health and profiling, restarts and world resets, and random numbers and RSA. |
There is no host call for scheduling: a plugin counts tick events (one per server tick, 20 a
second). Commands are declared in the manifest and arrive as command_run events.
Every call
| Call | Group | Wasm | What it does |
|---|---|---|---|
add_effect | entities | yes | Gives a creature or a player an effect (minecraft:regeneration) for ticks, at amplifier (nought is level I), as /effect give does: an instant one is spent at once, a longer one replaces a weaker or shorter one. |
add_effect_shown | entities | yes | add_effect, drawn as shown says: without particles (a plugin's own slow-down, which nobody else should see), without the icon, or ambient as a beacon's is. |
air | entities | yes | How many ticks of breath somebody has left, or None if they have gone. |
allows | players | yes | Whether somebody may run something needing this permission level. |
attach_entity | entities | yes | Makes entity follow leader, offset from it ([right, up, forward] in blocks, with the leader facing forward): whenever the leader is moved (move_entity), the follower is put at its offset from it, turned with its facing, and sent there in the same call. |
attribute | entities | yes | An attribute's current value on somebody -- base, /attribute modifiers, effects and the modifiers their worn enchantments put there -- or None for an attribute this entity does not have, or an entity that has gone. |
ban | players | yes | Puts name on the server's own ban list, with pardon and the login's refusal to go with it. |
banned | players | yes | Whether name stands banned on the server's list now. |
biome_at | blocks | yes | The biome at a position, as the player standing there is in it (minecraft:plains): the game's computed biome, through the same zoom the client is told of. |
block_at | blocks | yes | The block at a position, by name, or None if that chunk is not readable. |
block_data | blocks | yes | The block entity there as SNBT, as /data get block reads it: its id and what its type saves, with no position. |
block_is | blocks | yes | Whether the block there has one of the game's own per-state facts. |
block_property | blocks | yes | The value of one of a block state's properties, as the game spells it. |
block_state_at | blocks | yes | The whole state at a position, with its properties (minecraft:oak_stairs[facing=east,...]), or None if that chunk is not readable: what a plugin needs to put a block back exactly, through set_block. |
blocks_are | blocks | yes | block_is for many positions in one call: one answer per position, in order, each None where block_is would answer None (a chunk that is not readable). |
boss_bar_hide | tab-and-scoreboard | yes | Takes one of this plugin's boss bars off a player's screen; false if they did not have it. |
boss_bar_show | tab-and-scoreboard | yes | Shows one person a boss bar, or changes it if they have it: id is the plugin's own name for it, and the server keeps the wire's for each plugin and id, so the game's own bars -- raids, the wither, the dragon, /bossbar -- are never touched. |
broadcast | text | yes | Sends everybody one. |
broadcast_text | text | yes | Sends everybody a line of formatted chat; how many it went to. |
can_see | players | yes | Whether viewer may see subject, for a plugin that lists players to a player. |
can_spawn_at | creatures | yes | Whether a creature of kind could be put with its feet in the block at, by the game's spawn placement for the kind (SpawnPlacements): standing on something solid with room for its body and no fluid at its feet, in water for a fish, in lava for a strider. |
cancel_world_reset | server | yes | Takes back a reset asked for and not yet done. |
capture_chat | text | yes | Takes player's next chat line for this plugin: it arrives as a bus call from rustmc:chat ({"op": "chat.captured", "player", "text"}) and goes nowhere else -- no player_chat hook or event, no log line, no broadcast -- so an answer typed in chat (a password, a name) is seen by the plugin that asked and by nobody else. |
chat_completions | text | yes | Changes the words a player's chat box offers to finish as they type (Paper's addCustomChatCompletions): an emoji's :shortcode:, a channel's name. |
check_blocks | blocks | yes | Whether every name is a block state this build knows: an error naming the first that is not. |
chunk_on_disk | worlds | yes | Whether a chunk has been written to disk (may read a region file's header from disk when it is not cached; refused past 1,875,000 chunks from the origin). |
chunks_generated | map-and-generation | yes | What became of the chunks this plugin queued in that world since it last asked. |
clear_respawn | player-state | yes | Forgets a player's respawn point, so they respawn at the world spawn; whether anybody was there. |
client_brand | players | yes | What a client calls itself, from minecraft:brand, if it ever said. |
container_add | inventory | yes | Puts up to count of item into the block container at a position -- topping up its stacks first, then empty slots -- and answers how many went in. |
container_remove | inventory | yes | Takes up to count of item out of the block container at a position, answering how many came out: what a rollback of items put in needs. |
creature_order | creatures | yes | Tells one of this plugin's plugin-driven creatures what to do from its next tick until it is told something else (Order); an order it was carrying out ends replaced. |
creature_state | creatures | yes | How a creature is: where it is, its health, its mind, its owner, the order it is carrying out and whom at, and how its walk is going. |
damage | entities | yes | Hurts somebody, by a named cause. |
damage_by | entities | yes | Hurts an entity -- a player or a creature -- by a named damage type, struck by attacker: the blow is theirs as a sword's is, so a kill is credited to them (the death message names them, a creature's loot and experience are a player kill's) and the victim remembers who hit it last. |
damage_saying | entities | yes | damage, saying what to put in chat if it kills a player: the death message is their name, a space, and died (left the world gives Steve left the world). |
destroy_block | blocks | yes | Level.destroyBlock(pos, false): the block breaks -- its break particles and sound, the fluid it held left behind, BLOCK_DESTROY heard -- and drops nothing. |
disabled_systems | settings | yes | The vanilla systems switched off at plugin's request: its manifest's disables narrowed to the names the server checks, hunger, mob_spawning and natural_regen (VANILLA_SYSTEMS). |
dismount | entities | yes | Takes rider off whatever it is riding, as a player crouching does: entity_dismounted goes first and a plugin may cancel it. |
drop_item | inventory | yes | Drops a stack into the world as an item entity at at: item with count and data components (as give_item takes them), moving at velocity blocks a tick or with the little scatter a dropped item has. |
edit_cursor | inventory | yes | edit_slot for the stack on the cursor: its components set and removed, and with count its count set too (nought empties the cursor; otherwise 1 to what the stack, as edited, stacks to), only if it is still the stack stamp describes. |
edit_slot | inventory | yes | Changes the components of the stack in one slot of a player's own inventory, in place and only if it is still the stack stamp (from inventory_slot) describes: the count may have moved, nothing else. |
enchantment_level | entities | yes | What level of an enchantment somebody is wearing in one equipment slot. |
entities_in | entities | yes | The creatures and players in world whose box comes within radius of centre (the nearest point of the box, so a tall creature beside a blast is reached by its legs), with where each stands and the box that was tested: for a blast hurting what is near it. |
entity_unit | entities | yes | One draw from a creature's own stream, in 0.0..1.0. |
entity_velocity | entities | yes | How fast an entity is going, in blocks a tick: a creature's or a boat's own velocity, a player's as player_motion has it, and for a vehicle its driver's client moves (a ridden boat, horse or happy ghast), the distance between the last two positions the client reported, over the ticks between them. |
entity_viewers | entities | yes | The online players who see an entity spawn_entity_for made; None for one that is not such an entity. |
exhaust_for | entities | yes | Charges somebody the hunger this damage source costs. |
experience_points | player-state | yes | The experience somebody could spend, in points: every level they have, and the bar's progress towards the next (Player.calculateTotalExperiencePoints, not the lifetime score). |
fire_ticks | entities | yes | How long somebody stays alight, in ticks, or None if they have gone. |
fluid_at | blocks | yes | What fluid is at a position: "minecraft:water", "minecraft:lava", or None. |
game_mode | player-state | yes | The game mode a player is in; None for a player who is not here. |
game_rule_flag | worlds | yes | A boolean game rule, by the short name /gamerule uses. |
game_rule_number | worlds | yes | A numeric game rule, by the short name /gamerule uses. |
give | inventory | yes | Puts something in somebody's inventory, returning how many did not fit. |
give_experience | player-state | yes | Gives experience points, as /xp add <player> <points>, or takes them when points is negative. |
give_item | inventory | yes | give, with data components: a name, lore, a glint, enchantments, a player's head -- anything /give can put on an item, spelt as /give spells it (each component's id and its SNBT, such as ("minecraft:custom_name", "{text:'Key',color:'gold'}")). |
give_stack | inventory | yes | Gives count of exactly the stack snbt (text from take_slot) describes, spread over slots as give_item spreads it, answering how many did not fit -- or, with spill, dropping what did not fit at the player's feet as that same stack and answering nought. |
guard_hold | blocks | yes | Holds every block as protected, or lets go: what a plugin sets while it loads its zones. |
guard_world_defaults | blocks | yes | Sets what the guard allows of forces nobody controls in one world's blocks that no zone covers, as a zone's flags bits (1 blasts, 2 creatures, 4 fire): with Some(0) none of them in the wild. |
guard_zones | blocks | yes | Adds or replaces put and removes remove in the guard's table for one world, what the game's own forces ask natively: fluids, pistons, hoppers, dispensers, fire, growth, blasts and creatures. |
has_effect | entities | yes | Whether a status effect is on somebody at this moment. |
heal | player-state | yes | Heals a player by amount, up to their maximum: what a regeneration tick does, without the effect. |
held_item | inventory | yes | What somebody is holding. |
hidden | players | yes | The permission level a player is hidden below, or None when everybody can see them. |
hide_sidebar | tab-and-scoreboard | yes | Takes away the sidebar show_sidebar gave a player; false if they had none. |
host_pack | packs | yes | Hosts a resource pack on the server's own pack host and answers its URL and SHA-1, for push_pack. |
http_fetch | network | yes | Starts fetching url (https only, a GET), answering at once with a number to ask http_result about. |
http_result | network | yes | A finished fetch: its status and up to length bytes (at most 1 MiB) of the body from byte offset on, or why it failed. |
http_send | network | yes | Sends request to one of this plugin's outbound grants: the plugin-outbound.<plugin>.<grant> section of rustmc.yml, whose URL the path is appended to. |
inspect_close | inventory | yes | Closes a view inspect_open opened: for when viewer has lost the right to it. |
inspect_open | inventory | yes | Opens another player's inventory (view is inventory) or ender chest (ender), kept up to date while it is open, for viewer: the account's file if they are offline. |
inventory_cursor | inventory | yes | The stack a player holds on the cursor in an open screen -- picked up and not yet put down -- as inventory_slot reports a slot's, with its stamp. |
inventory_slot | inventory | yes | What is in one slot of a player's own inventory, numbered as the game's Inventory numbers them: 0-8 the hotbar, 9-35 the rest, 36-39 the armour (feet, legs, chest, head), 40 the off hand. |
is_bedrock | players | yes | Whether a player is connected through Bedrock rather than a Java client. |
is_in_rain | entities | yes | Whether rain is falling on somebody where they stand. |
is_on_ground | entities | yes | Whether somebody is standing on something. |
is_sneaking | entities | yes | Whether somebody is crouching. |
item_cooldown | inventory | yes | The ticks left of a group's cooldown (set_item_cooldown), nought when it is not cooling: the server's own pearls and wind charges included. |
item_count | inventory | yes | How many of item somebody carries: their main inventory, hotbar, armour and offhand (not the crafting grid). |
item_count_where | inventory | yes | item_count by what the stacks carry: of item (any item when None), only the stacks whose minecraft:custom_data holds every (key, snbt) of custom_data -- a plugin's own items, counted in one call whatever they are made of, such as [("myplugin:id", "\"timber\"")]. |
item_sum_where | inventory | yes | item_count_where, summing a number the stacks carry rather than counting them: for each matching stack, its count times the whole number its minecraft:custom_data holds at sum_key -- or times one where the key is missing or not a whole number. |
kick | players | yes | Throws somebody off the server, as /kick does: their client is shown reason (plain text, as message takes it; empty is the game's "Kicked by an operator") and closes the connection. |
latency | players | yes | A player's latency in milliseconds, as their keep-alive answers measure it: the number the tab list's bars are drawn from (connection.latency(), a running average). |
list_fake_entries | tab-and-scoreboard | yes | Shows one viewer plugin's fake tab-list rows -- TAB's layout -- in place of the ones it showed them before: up to MAX_FAKE_ENTRIES profiles that are nobody, each with its own text, latency, game mode, skin and order. |
list_fake_entries_batch | tab-and-scoreboard | yes | list_fake_entries for many viewers at once, up to MAX_BATCH rows in all; how many viewers were there. |
list_score_render | tab-and-scoreboard | yes | Whether the plugin tab-list objective draws its numbers as numbers or as hearts, for every viewer. |
load | storage | yes | Reads one back, or None if it was never stored. |
local_difficulty | worlds | yes | The local difficulty at a place, which is not the world's difficulty setting. |
log | server | yes | Writes a line to the server's own log, tagged with the plugin's name. |
may_interact | entities | yes | Entity.mayInteract(level, pos): whether this body may change the block there. |
menu_close | menus | yes | Shuts a menu this plugin opened; answers whether it was still open. |
menu_open | menus | yes | Opens a menu for a player: a chest-like screen of rows (1 to 6) rows of nine, titled title, with these slots filled. |
menu_set | menus | yes | Changes slots of a menu this plugin opened, while the player still has it open; answers whether it was still open. |
message | text | yes | Sends one person a line of chat. |
message_text | text | yes | Sends one person a line of formatted chat: a text component as JSON (the game's own form: {"text": "Hi", "color": "gold", "extra": [...]}, or a bare string, or a list). |
mount | entities | yes | Puts rider on vehicle, as /ride <rider> mount <vehicle> does: a player, a creature or a display on a creature, a display, a boat or a minecart -- however many are already on it, so a display rig and extra seats stack onto one mount. |
move_entities | entities | yes | Moves several entities at once, each as move_entity does: a plugin's vehicle moving its root, its rig and every seat each tick in one call. |
move_entity | entities | yes | Puts an entity somewhere else in its world, facing yaw and pitch. |
net_close | network | yes | Closes a connection once what is waiting to go has gone. |
net_listen | network | yes | Opens one of this plugin's grants: the plugin-ports.<plugin>.<grant> section of rustmc.yml. |
net_poll | network | yes | What happened on this plugin's ports, oldest first. |
net_respond | network | yes | Answers an http request, once. |
net_send | network | yes | Sends bytes on a connection, after an http one's net_respond said more. |
net_unlisten | network | yes | Closes a grant and every connection on it. |
network_name | server-network | yes | This server's name on the network, network.name in rustmc.yml: None while the network is off, which is how a plugin that works alone or across servers tells which. |
network_players | server-network | yes | Everyone online anywhere on the network, this server's players first, each with the server they are on and whether that server hides them. |
network_publish | server-network | yes | Sends payload on channel to every peer whose link is up, and to this server's own subscribers -- the publisher among them, if it subscribed -- unless local is false. |
network_send | server-network | yes | Sends player to the peer named server, by the transfer packet to its join address in rustmc.yml. |
network_servers | server-network | yes | Every server on the network, this one first and then each peer rustmc.yml names: whether this server's link to it is up (a publish now reaches it), how many players it has online, hidden ones not counted, and its max-players (nought until a peer has said). |
network_subscribe | server-network | yes | Hears channel as the network_message event, from every server, this one included. |
network_unsubscribe | server-network | yes | Stops hearing what network_subscribe named, spelt as it was. |
now | server | yes | The wall clock: milliseconds since 1970 (UTC). |
nudge_view | player-state | yes | Turns a player's view by dyaw and dpitch degrees from wherever it is on their screen: ClientboundPlayerRotationPacket with both relative flags, so a recoil kick adds to the player's own aim rather than snapping it back to where the server last heard it was. |
objective_title | tab-and-scoreboard | yes | The title of the plugin objective in slot (below_name or list), a text component, for every viewer: what below-name draws after each number. |
packet_decode | packets | yes | A packet's body as its named fields (a map), for a packet this server has a schema for: ProtocolLib's PacketContainer. |
packet_encode | packets | yes | The other way: named fields, every one given, as the packet's bytes. |
packet_schemas | packets | yes | Every packet packet_decode and packet_encode know, each with its fields and their kinds: {"play.clientbound.set_health": [["health", "float"], ...]}. |
pardon | players | yes | pardon: lifts name's ban, whoever made it, and answers whether there was one. |
particle | worlds | yes | Shows count of a particle at a place, scattered over spread (each axis's standard deviation) and moving at speed, to everybody near enough to see. |
passengers | entities | yes | Who is on an entity, in order: the first is the one who steers. |
play_sound | worlds | yes | Plays one of the game's sounds to one player, where they stand: sound by name (minecraft:entity.experience_orb.pickup), category the client's volume slider it obeys (players, blocks, hostile, neutral, ambient, weather, records). |
player_motion | player-state | yes | How a player is moving: their velocity, and whether they are sprinting, sneaking and on the ground. |
player_name | players | yes | A player's name, or None if they have gone. |
player_named | players | yes | Finds somebody by name, case-insensitively, as a command would. |
player_uuid | players | yes | A player's uuid, as the sixteen bytes it is. |
players | players | yes | Everybody currently connected. |
players_in | entities | yes | The players in world whose box meets the box between the corners min and max (in either order), with where each stands. |
plugin_call | bus | yes | The plugin bus: a request from plugin to the plugin named target, answered at once. |
plugin_emit | bus | yes | The plugin bus: news from plugin on topic, to every other plugin listening. |
plugin_state | bus | yes | What became of the plugin called name: running; stopped, when it was unloaded or its file is in the plugin folder and it is not loaded; none, when there is no such plugin. |
pop_pack | packs | yes | Takes a pack back off. |
position | entities | yes | Where somebody is. |
profiler | server | yes | The server's sampling profiler: op is start (sampling every interval_ms), stop (answers the report: each system's share of the samples and its time, as JSON) or status. |
push_pack | packs | yes | Offers a resource pack to one player, on top of any they already hold. |
queue_chunks | map-and-generation | yes | Queues chunks to be generated and written off the tick: at most 4096 outstanding per plugin and world, none past 1,875,000 chunks from the origin, None when read-only or stopping. |
raycast | entities | yes | Casts a ray, run by the server so it costs the plugin no fuel: from a point or a player's eyes, up to max_distance blocks (at most 512), against blocks' collision shapes (a slab stops it at its top, an open trapdoor not at all; fluids never) and entities' boxes, as RayFilter allows; the first thing met, or None. |
read_blocks | blocks | yes | Every cell of the box between two corners, in one call: what an edit reads before it writes. |
recipes | recipes | yes | One page of the recipes the server has loaded, as vanilla recipe JSON keyed by id: the game's own and every one the world's enabled datapacks add, a datapack's replacing the game's of the same id. |
recipes_revision | recipes | yes | The revision of the recipe set recipes pages through: 16 hex digits that change when a reload changes any recipe, and only then. |
refresh_commands | players | yes | Sends a player their command list again, decided afresh, at the next tick: for a permissions plugin, after a change that adds or removes a command they may run. |
release_blocks | blocks | yes | Gives back states reserve_blocks took, by the same patterns; all of the plugin's in that world for none. |
release_chat | text | yes | Ends this plugin's capture of a player's next line; whether one was open. |
remove_attribute_modifier | entities | yes | Takes a modifier off by its id. |
remove_effect | entities | yes | Takes one effect off a creature or a player, as /effect clear <target> <effect> does: its attribute modifiers go with it and the client is told. |
remove_entity | entities | yes | Takes an entity out of the world without a death: any creature, display, boat or cart, or item lying on the ground, not only the plugin's own. |
render_web_map | map-and-generation | yes | Draws a world's web map now, once: Ok(true) when drawing starts, Ok(false) when it is drawn or being drawn already (or web-map.render is on-create), Err when the web map is off or does not draw that world. |
request_restart | server | yes | Stops the server as /stop does -- every plugin told server_stopping and stopped, the world and everybody in it saved -- and then ends the process with RESTART_EXIT_CODE rather than nought, so the script or service that started it starts it again (see docs/restarting.md). |
reserve_blocks | blocks | yes | Reserves block states in one world for this plugin's own blocks: each of states is a state or a pattern (minecraft:note_block[instrument=banjo,note=3] is every state with those, whatever else; a bare name is every state of the block). |
rotation | entities | yes | Which way somebody faces: yaw (degrees clockwise from +Z, as the game counts it) and pitch. |
rsa_decrypt | server | yes | Takes the PKCS#1 v1.5 padding off an RSA block, with a PKCS#8 DER key. |
rsa_generate | server | yes | A new RSA-2048 key pair. |
save_player | player-state | yes | Writes an online player's data file now, rather than at the next save. |
schedule_world_reset | server | yes | Asks for the world to be reset the next time the server starts: before it opens, the world directory is renamed aside with the time in its name (nothing is deleted) and a fresh one is made, with reset.seed or a random seed and the generator the server is configured with, its sidecars written anew. |
schematic_cells | schematics | yes | Cells start onwards of a loaded schematic, at most 65,536, each an index into its names, x fastest, then z, then y. |
schematic_close | schematics | yes | Lets go of a ticket, whatever it was doing. |
schematic_entities | schematics | yes | Block entities start onwards of a loaded schematic, at most count, 64 a call and 1 MiB: where, from the box's lowest corner, and SNBT set_block_data takes. |
schematic_finish | schematics | yes | Writes a saved schematic out on a thread of its own, whole or not at all, as Sponge version 3. |
schematic_list | schematics | yes | What is in this plugin's schematic folder, plugins/<plugin>/schematics, at most 1,024 names. |
schematic_load | schematics | yes | Starts reading <name>.schem from this plugin's folder, a Sponge schematic of version 1 to 3, on a thread of its own, answering at once with a ticket for schematic_result. |
schematic_names | schematics | yes | Names start onwards of a loaded schematic, at most 256: None for a block this server does not know. |
schematic_put | schematics | yes | The next piece of a schematic being saved. |
schematic_result | schematics | yes | How a load or save went: None while it runs and for a ticket this plugin does not hold. |
schematic_save | schematics | yes | Starts saving <name>.schem to this plugin's folder: a ticket for schematic_put, and then schematic_finish. |
secure_random | server | yes | length bytes from the operating system's cryptographic source, at most 4096: for keys, tokens and challenges. |
selected_slot | player-state | yes | The hotbar slot a player has selected, 0-8, numbered as inventory_slot numbers it; None for one not online. |
send_packet | packets | yes | Sends one player a packet, as the game would have: packet names it as its hook point does (play.clientbound.set_title_text, packet. optional) and body is its bytes -- from packet_encode, or written by hand. |
send_payload | packets | yes | Sends a message on a plugin channel. |
server_health | server | yes | How the server is doing, as JSON: TPS, MSPT (average and longest) and CPU over 5 s, 10 s, 1 min, 5 min and 15 min, memory, and the players, creatures and worlds. |
set_air | entities | yes | Sets it. |
set_attribute_modifier | entities | yes | Puts a modifier on one of somebody's attributes, as /attribute <target> <attribute> modifier add does but replacing one of the same id rather than refusing: id is a namespaced name the plugin owns (myplugin:aiming), operation is add_value, add_multiplied_base or add_multiplied_total. |
set_below_name | tab-and-scoreboard | yes | The number one viewer sees under target's name, with its own number format; None takes it away. |
set_below_name_batch | tab-and-scoreboard | yes | set_below_name for up to MAX_BATCH entries; how many applied. |
set_block | blocks | yes | Puts a block there. |
set_block_data | blocks | yes | Merges snbt, a compound, into the block entity there, as /data merge block does: a compound field merged into the one held, any other field replacing it. |
set_blocks | blocks | yes | set_block for many blocks in one call: each position set to its state (properties and all, as set_block takes one), in the order given, each as set_block sets it. |
set_blocks_data | blocks | yes | set_block_data for many positions in one call, in the order given, each as set_block_data writes it: a landmark's signs at once. |
set_creature_ai | creatures | yes | Changes whose decisions one of this plugin's creatures acts on. |
set_creature_drops | creatures | yes | Decides what one of this plugin's creatures leaves when it dies, instead of its loot table and its equipment, and what experience it is worth; None gives it back its own. |
set_display | entities | yes | Changes a display's fields (SNBT: {text:"Hi",billboard:"center"}), as /data merge entity would, and shows everybody watching. |
set_entity_velocity | entities | yes | Pushes an entity: sets its velocity, in blocks a tick, and sends it to everybody watching -- ClientboundSetEntityMotionPacket, what an explosion or a wind charge sends. |
set_entity_viewers | entities | yes | Replaces who sees an entity spawn_entity_for made: those taken off are sent its removal, those added are sent it whole. |
set_fire_ticks | entities | yes | Sets it. |
set_food | player-state | yes | Sets a player's food bar: food 0 to 20, saturation 0 to food, as the game keeps them. |
set_game_mode | player-state | yes | Puts a player in a game mode, as /gamemode does. |
set_health | player-state | yes | Sets a player's health, as /data cannot: above nought and at most their maximum (which Health Boost raises), clamped to it. |
set_hidden | players | yes | Hides a player from everybody who may not run something needing permission level or, given viewers, from everybody but those players (an unlisted operator too, and an empty list hides them from all): gone from their tab list and their world, as if they had left. |
set_hidden_account | players | yes | set_hidden for an account, online or not: a player arriving on it is hidden before anything is sent about them. |
set_item_cooldown | inventory | yes | Starts an item cooldown, as an ender pearl's: for ticks the client draws the sweep across every stack in the group, and it replaces any cooldown of the group running; nought ends one. |
set_list_game_mode_shown_for | tab-and-scoreboard | yes | The game mode one viewer's tab list shows for target, over their real one -- a spectator shown as survival, so they are not greyed out at the bottom -- or None for the real one. |
set_list_game_mode_shown_for_batch | tab-and-scoreboard | yes | set_list_game_mode_shown_for for up to MAX_BATCH entries; how many applied. |
set_list_latency | tab-and-scoreboard | yes | The latency everybody's tab list shows for target, in milliseconds, over the measured one (a ping spoof); None shows the measured one again. |
set_list_name | tab-and-scoreboard | yes | Shows a player in everybody's tab list under name (a text component), or as themselves again for None; kept for players who join later. |
set_list_name_for | tab-and-scoreboard | yes | Shows target in one viewer's tab list under name (a text component), over the name set_list_name gives everybody; None shows that viewer what everybody sees again. |
set_list_name_for_batch | tab-and-scoreboard | yes | set_list_name_for for up to MAX_BATCH entries at once, each viewer's sent as one packet. |
set_list_order | tab-and-scoreboard | yes | Where a player sorts in everybody's tab list: higher first. |
set_list_score | tab-and-scoreboard | yes | The number one viewer's tab list shows beside target, as set_below_name does under their name: the tab-list objective, drawn as a number or as hearts (list_score_render). |
set_list_score_batch | tab-and-scoreboard | yes | set_list_score for up to MAX_BATCH entries; how many applied. |
set_listed_for | tab-and-scoreboard | yes | Whether target is in one viewer's tab list at all: what a per-world player list hides people with. |
set_listed_for_batch | tab-and-scoreboard | yes | set_listed_for for up to MAX_BATCH entries; how many applied. |
set_nametag | tab-and-scoreboard | yes | Gives a player a nametag: a prefix and suffix (text components) around their name, over their head and in the tab list, its colour, who sees it and who pushes them. |
set_nametag_batch | tab-and-scoreboard | yes | set_nametag for up to MAX_BATCH players at once; how many applied (the player there). |
set_nametag_for | tab-and-scoreboard | yes | Gives target a nametag as one viewer sees it, over the one set_nametag gives everybody: a relational prefix or suffix, or the tag hidden from that viewer alone (visibility: never). |
set_nametag_for_batch | tab-and-scoreboard | yes | set_nametag_for for up to MAX_BATCH entries; how many applied. |
set_passengers | entities | yes | Puts exactly riders on vehicle, in that order, as /ride would one by one but with the order kept as given: the first steers, and the client seats each at its place in the list (a happy ghast's four, a camel's two; past the last, at the last). |
set_respawn | player-state | yes | Sets where a player respawns after dying, as /spawnpoint does: the block they stand in at at in world, facing yaw, needing no bed (two free blocks, or the world spawn). |
set_slot | inventory | yes | Puts a stack in one slot of a player's own inventory, numbered as inventory_slot numbers them, in place of whatever was there: count 0 empties it. |
set_tab_header | tab-and-scoreboard | yes | The lines above and below one player's tab list, as text components ("" for none). |
set_ticks_frozen | entities | yes | Sets it. |
set_time_of_day | worlds | yes | Sets a world's clock, as /time set does. |
set_world_border | worlds | yes | Moves it. |
setting_set | settings | yes | Changes one of plugin's own settings, as the web portal does: checked against what it declared, kept in plugins/<plugin>/settings.json, and settings_changed told to every other plugin that hears it (the one that changed it knows). |
settings | settings | yes | plugin's settings, every declared one, as a JSON object of key to value: what the server keeps, or the default where nobody has changed it. |
show_sidebar | tab-and-scoreboard | yes | Shows one person a sidebar of their own: a title and up to 15 lines, top to bottom, each a text component as message_text takes them, drawn without numbers. |
show_sidebar_lines | tab-and-scoreboard | yes | Shows one person a sidebar whose lines each have their own right-hand side: a text component where the number would be, or a number, or nothing (TAB's text||format||score). |
show_title | text | yes | Shows one person a title across the middle of their screen, and a subtitle under it: text components as message_text takes them. |
sound_at | worlds | yes | Plays a sound at a place, to everybody near enough to hear it, as play_sound names one. |
spawn_creature | creatures | yes | Makes one of the game's creatures for this plugin, dressed and tuned as options says (CreatureOptions): a name, equipment with data components, attribute bases, persistent, silent and invulnerable, and its mind -- its own vanilla one, none, or the plugin's (creature_order). |
spawn_entity | entities | yes | Makes an entity, as /summon would with the same tag (nbt, SNBT; empty for none), and answers its id: a creature, an armour stand, a mannequin, an interaction box, or a display (minecraft:item_display, block_display, text_display, whose fields -- item, block_state, text, transformation, billboard and the rest -- are the game's own). |
spawn_entity_for | entities | yes | spawn_entity for some players only: a display (item_display, block_display, text_display), an interaction or a mannequin, whose spawn, movement and data go to viewers and to nobody else -- a building preview, a marker meant for one player. |
sql_result | storage | yes | A finished batch's outcome, taken: each statement's affected rows as a JSON list, or why it failed (the database's own message, the URL and password taken out). |
sql_submit | storage | yes | Queues SQL for an external MySQL database -- one a website reads, whose schema the plugin owns; not the plugin's own storage. |
statistic | player-state | yes | One of a player's statistics, as the statistics screen counts it: stat is its type (minecraft:custom, minecraft:mined, minecraft:killed, ...) and key what it counts (minecraft:play_time, minecraft:stone, minecraft:zombie). |
storage_backend | storage | yes | Which backend this plugin's tables are in: json, sqlite or mysql. |
storage_count | storage | yes | How many rows of the table have a key starting with prefix. |
storage_delete | storage | yes | Deletes one row, answering whether there was one. |
storage_drop | storage | yes | Drops one of this plugin's own tables: every row in it, at once, in whichever backend it is in. |
storage_get | storage | yes | One row of this plugin's table, as JSON text, or None when there is no such row. |
storage_land | storage | yes | Waits, for a bounded time, for this plugin's bulk writes to land: for a plugin's stop. |
storage_migrate | storage | yes | Starts moving this plugin's rows from backend from (which must be the one it is on) to to, and answers at once; storage_migration follows it. |
storage_migration | storage | yes | This plugin's latest migration since the server started, or None. |
storage_outcome | storage | yes | What became of a storage_put_many. |
storage_put | storage | yes | Inserts or replaces one row. |
storage_put_many | storage | yes | Keeps many rows in one call: each table's in one write of the backend, in the order given. |
storage_scan | storage | yes | Rows whose key starts with prefix, in byte order of the key, after after when given, at most limit (which is at most 1000) of them. |
store | storage | yes | Stores a value for this plugin, under a key of its choosing. |
swing_arm | player-state | yes | Swings a player's arm, as a hit or a use swings it, for them and everybody who can see them: the main hand, or the off hand with off_hand. |
take_held | inventory | yes | Takes up to count of item from the stack in a player's main hand, if that stack is item, and tells their client; how many were taken. |
take_item | inventory | yes | Takes up to count of item out of somebody's inventory, in /clear's order: the hotbar, the main inventory, then armour and the offhand (never the crafting grid). |
take_item_where | inventory | yes | take_item by what the stacks carry, as item_count_where matches them: up to count of the stacks whose custom data holds every (key, snbt), of item or of any item. |
take_slot | inventory | yes | Takes the whole stack out of one slot of a player's own inventory (numbered as inventory_slot numbers them) -- with a stamp (from inventory_slot), only if it is still the stack the stamp describes; with none, whatever is there -- and answers it as lossless text with its item and count. |
teleport | player-state | yes | Moves somebody. |
tick | server | yes | How many ticks since the server started. |
tick_health | server | yes | How long ticks are taking. |
ticks_frozen | entities | yes | How frozen somebody is, in ticks, or None if they have gone. |
time_of_day | worlds | yes | The time of day, in ticks, out of twenty-four thousand. |
unqueue_chunks | map-and-generation | yes | Drops this plugin's chunks still waiting in that world; one being built finishes and is reported. |
vehicle_of | entities | yes | What an entity is riding; None for nothing, or an entity not there. |
vitals | player-state | yes | Health, food and saturation. |
watch_input | players | yes | Starts or stops telling this plugin which movement keys a player holds: with it on, a player_input event each time the keys their client reports change -- forward, backward, left, right, jump, sneak, sprint -- and never while they hold the same ones. |
watch_look | players | yes | Starts or stops telling this plugin where a player looks: with it on, a player_look event each tick the player's yaw or pitch has changed since they were last told -- at most one a tick per player, carrying where they look by then. |
web_map_marker | map-and-generation | yes | Puts a labelled marker on a world's web map, or moves or renames the plugin's marker of the same id: Ok(true) when the map changed, Ok(false) when it was so already, Err when the web map is off, does not draw that world, or the marker is refused. |
web_map_remove_marker | map-and-generation | yes | Takes the plugin's marker of that id off a world's web map: Ok(true) when there was one, Ok(false) when there was none, Err when the web map is off or does not draw that world. |
world_border | worlds | yes | Where the world stops: the centre, and the full width rather than the half-width. |
world_border_damage | worlds | yes | What being outside costs: the damage per block past the safe zone, and the safe zone. |
world_ceiling | worlds | yes | One past the highest y a block may exist at in this world. |
world_floor | worlds | yes | The lowest y a block may exist at in this world. |
world_id | worlds | yes | What tells this world from any other that has stood in its place: None for a dimension this server does not serve, or a folder it cannot write to. |
world_of | entities | yes | Which world somebody is in. |
world_sidecar | worlds | yes | A file the world's generator left beside it (Generator::sidecars), by its plain file name, or None where there is none. |
world_spawn | worlds | yes | Where a new player appears in this world: what a /spawn command sends somebody to. |
worlds | worlds | yes | Every world this server serves, by name: minecraft:overworld and whichever of the Nether and the End are enabled. |
worn | entities | yes | What somebody is wearing in one equipment slot, as an item id. |
write_blocks | blocks | yes | Writes the box between two corners in one call: each cell an index into palette, x fastest, then z, then y, and KEEP_CELL for a cell left as it is. |
From docs/api/reference/host-calls.md in the RustMC repository at bbd81209ad.