pub struct NullServer {
pub game_dir: String,
}Expand description
A Server that does nothing: every query comes back empty, every
action reports failure. Enough to run mod logic that only needs a handle
(yog bench benchmarks, unit tests). game_dir is where the mod’s
storage goes — point it at a scratch directory.
Fields§
§game_dir: StringImplementations§
Source§impl NullServer
impl NullServer
Sourcepub fn new(dir: impl Into<String>) -> NullServer
pub fn new(dir: impl Into<String>) -> NullServer
A null server whose game directory is dir.
Trait Implementations§
Source§impl Clone for NullServer
impl Clone for NullServer
Source§fn clone(&self) -> NullServer
fn clone(&self) -> NullServer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NullServer
impl Debug for NullServer
Source§impl Default for NullServer
impl Default for NullServer
Source§fn default() -> NullServer
fn default() -> NullServer
Returns the “default value” for a type. Read more
Source§impl Server for NullServer
impl Server for NullServer
Source§fn get_block(&self, dimension: &str, pos: BlockPos) -> Option<String>
fn get_block(&self, dimension: &str, pos: BlockPos) -> Option<String>
Registry id of the block at
pos in dimension
(e.g. "minecraft:stone"), or None if the dimension/position is
unavailable. Call from the server thread (e.g. an event handler).Source§fn set_block(&self, dimension: &str, pos: BlockPos, block_id: &str) -> bool
fn set_block(&self, dimension: &str, pos: BlockPos, block_id: &str) -> bool
Set the block at
pos in dimension to block_id — a registry id
or, like /setblock, a state ("minecraft:water_cauldron[level=3]").
Returns whether the change was applied. Call from the server thread.Source§fn give_item(&self, player: &str, item_id: &str, count: u32) -> bool
fn give_item(&self, player: &str, item_id: &str, count: u32) -> bool
Give
count of item_id to the named player. Returns whether it worked
(player online, item valid). Call from the server thread.Source§fn teleport(&self, player: &str, x: f64, y: f64, z: f64) -> bool
fn teleport(&self, player: &str, x: f64, y: f64, z: f64) -> bool
Teleport the named player to
(x, y, z) in their current world. Returns
whether it worked. Call from the server thread.Source§fn send_to_player(&self, player: &str, channel: &str, payload: &[u8]) -> bool
fn send_to_player(&self, player: &str, channel: &str, payload: &[u8]) -> bool
Send a raw-byte packet to the named player on
channel (server → client).
Returns whether the player was online. Payload is opaque bytes — no NBT.Source§fn send_to_server(&self, channel: &str, payload: &[u8]) -> bool
fn send_to_server(&self, channel: &str, payload: &[u8]) -> bool
Send a raw-byte packet to the server on
channel (client → server).
Only works in a client context; returns whether it was sent.Source§fn entity_teleport(&self, uuid: &str, x: f64, y: f64, z: f64) -> bool
fn entity_teleport(&self, uuid: &str, x: f64, y: f64, z: f64) -> bool
Teleport any entity (by UUID) within its current world.
Source§fn entity_position(&self, uuid: &str) -> Option<(f64, f64, f64)>
fn entity_position(&self, uuid: &str) -> Option<(f64, f64, f64)>
Position of an entity, or
None if not loaded.Source§fn entity_set_health(&self, uuid: &str, health: f32) -> bool
fn entity_set_health(&self, uuid: &str, health: f32) -> bool
Set a living entity’s health; returns whether it applied.
Source§fn entity_kill(&self, uuid: &str) -> bool
fn entity_kill(&self, uuid: &str) -> bool
Remove/kill an entity.
Source§fn spawn_entity(
&self,
entity_type: &str,
dimension: &str,
x: f64,
y: f64,
z: f64,
) -> Option<String>
fn spawn_entity( &self, entity_type: &str, dimension: &str, x: f64, y: f64, z: f64, ) -> Option<String>
Spawn an entity of
entity_type (e.g. minecraft:pig) at a position;
returns its UUID, or None on failure.Source§fn entity_add_effect(
&self,
uuid: &str,
effect_id: &str,
duration_ticks: i32,
amplifier: u8,
show_particles: bool,
) -> bool
fn entity_add_effect( &self, uuid: &str, effect_id: &str, duration_ticks: i32, amplifier: u8, show_particles: bool, ) -> bool
Apply a status effect to a living entity.
effect_id is a registry id
such as "minecraft:speed" or "minecraft:regeneration". amplifier is
0-based (0 = level I). Returns false if the entity or effect is unknown.Source§fn entity_remove_effect(&self, uuid: &str, effect_id: &str) -> bool
fn entity_remove_effect(&self, uuid: &str, effect_id: &str) -> bool
Remove a single status effect from a living entity.
Source§fn entity_clear_effects(&self, uuid: &str) -> bool
fn entity_clear_effects(&self, uuid: &str) -> bool
Clear all active status effects from a living entity.
Source§fn drop_loot(
&self,
table_id: &str,
dimension: &str,
x: f64,
y: f64,
z: f64,
) -> bool
fn drop_loot( &self, table_id: &str, dimension: &str, x: f64, y: f64, z: f64, ) -> bool
Roll a loot table and spawn the resulting item entities in the world.
table_id is the namespaced id, e.g. "minecraft:entities/zombie".Source§fn has_item_tag(&self, item_id: &str, tag_id: &str) -> bool
fn has_item_tag(&self, item_id: &str, tag_id: &str) -> bool
Returns whether
item_id (e.g. "minecraft:stone") belongs to tag_id
(e.g. "minecraft:planks").Source§fn has_block_tag(&self, block_id: &str, tag_id: &str) -> bool
fn has_block_tag(&self, block_id: &str, tag_id: &str) -> bool
Returns whether
block_id belongs to tag_id.Source§fn world_time(&self, dimension: &str) -> Option<i64>
fn world_time(&self, dimension: &str) -> Option<i64>
Game time in ticks since world creation (never wraps, keeps counting).
Source§fn world_set_time(&self, dimension: &str, time: i64) -> bool
fn world_set_time(&self, dimension: &str, time: i64) -> bool
Set the time-of-day (0 = dawn, 6000 = noon, 12000 = dusk, 18000 = midnight).
Only changes the visual time, not the absolute world age.
Source§fn world_is_raining(&self, dimension: &str) -> bool
fn world_is_raining(&self, dimension: &str) -> bool
Whether it is currently raining in the given dimension.
Source§fn world_set_weather(
&self,
dimension: &str,
raining: bool,
duration_ticks: i32,
) -> bool
fn world_set_weather( &self, dimension: &str, raining: bool, duration_ticks: i32, ) -> bool
Start or stop rain.
duration_ticks controls how long the weather lasts
(use 0 for a server-chosen default duration).Source§fn entity_velocity(&self, uuid: &str) -> Option<(f64, f64, f64)>
fn entity_velocity(&self, uuid: &str) -> Option<(f64, f64, f64)>
Current velocity
(vx, vy, vz) of any entity, or None if not loaded.Source§fn entity_set_velocity(&self, uuid: &str, vx: f64, vy: f64, vz: f64) -> bool
fn entity_set_velocity(&self, uuid: &str, vx: f64, vy: f64, vz: f64) -> bool
Set the velocity of any entity. Returns
false if not loaded.Source§fn entity_add_velocity(&self, uuid: &str, vx: f64, vy: f64, vz: f64) -> bool
fn entity_add_velocity(&self, uuid: &str, vx: f64, vy: f64, vz: f64) -> bool
Add a velocity impulse (cumulative with existing velocity).
Source§fn scoreboard_get(&self, objective: &str, player: &str) -> Option<i32>
fn scoreboard_get(&self, objective: &str, player: &str) -> Option<i32>
Score of
player on objective, or None if the objective doesn’t exist.Source§fn scoreboard_set(&self, objective: &str, player: &str, score: i32) -> bool
fn scoreboard_set(&self, objective: &str, player: &str, score: i32) -> bool
Set the score; returns
false if the objective doesn’t exist.Source§fn scoreboard_add(
&self,
objective: &str,
player: &str,
delta: i32,
) -> Option<i32>
fn scoreboard_add( &self, objective: &str, player: &str, delta: i32, ) -> Option<i32>
Add
delta to the score (negative = subtract). Returns the new score,
or None if the objective doesn’t exist.Source§fn play_sound(
&self,
dimension: &str,
x: f64,
y: f64,
z: f64,
sound_id: &str,
volume: f32,
pitch: f32,
) -> bool
fn play_sound( &self, dimension: &str, x: f64, y: f64, z: f64, sound_id: &str, volume: f32, pitch: f32, ) -> bool
Play a sound at
(x, y, z) in dimension. sound_id is a registry id
(e.g. "minecraft:entity.player.levelup"). All players within range hear
it. Returns false if the dimension is unknown.Source§fn play_sound_to_player(
&self,
player: &str,
sound_id: &str,
volume: f32,
pitch: f32,
) -> bool
fn play_sound_to_player( &self, player: &str, sound_id: &str, volume: f32, pitch: f32, ) -> bool
Play a sound at the named player’s current position. All players nearby
(including the target) hear it. Returns
false if the player is offline.Source§fn send_title(
&self,
player: &str,
title: &str,
subtitle: &str,
fadein: i32,
stay: i32,
fadeout: i32,
) -> bool
fn send_title( &self, player: &str, title: &str, subtitle: &str, fadein: i32, stay: i32, fadeout: i32, ) -> bool
Send a title+subtitle screen to a player. Pass empty strings to omit
either line. Timings are in ticks (20 ticks = 1 second).
Source§fn send_actionbar(&self, player: &str, message: &str) -> bool
fn send_actionbar(&self, player: &str, message: &str) -> bool
Send a short message to the action-bar (the line just above the hotbar).
Source§fn entity_rotation(&self, uuid: &str) -> Option<(f32, f32)>
fn entity_rotation(&self, uuid: &str) -> Option<(f32, f32)>
Yaw and pitch (degrees) of an entity by UUID, or
None if it does not
exist. Minecraft convention: yaw 0 = south, positive pitch looks down.Source§fn kick_player(&self, player: &str, reason: &str) -> bool
fn kick_player(&self, player: &str, reason: &str) -> bool
Disconnect
player with the given reason message.Source§fn set_gamemode(&self, player: &str, gamemode: &str) -> bool
fn set_gamemode(&self, player: &str, gamemode: &str) -> bool
Change a player’s game mode.
gamemode is one of "survival",
"creative", "adventure", "spectator" (or the abbreviations
"s", "c", "a", "sp"). Returns false if the player is offline
or gamemode is unrecognised.Source§fn bossbar_create(
&self,
id: &str,
title: &str,
color: &str,
style: &str,
) -> bool
fn bossbar_create( &self, id: &str, title: &str, color: &str, style: &str, ) -> bool
Create a new boss bar identified by
id (a namespaced id such as
"mymod:progress"). color: "pink" / "blue" / "red" / "green" /
"yellow" / "purple" / "white". style: "progress" /
"notched_6" / "notched_10" / "notched_12" / "notched_20".
Returns false if a bar with that id already exists.Source§fn bossbar_remove(&self, id: &str) -> bool
fn bossbar_remove(&self, id: &str) -> bool
Remove a boss bar (also removes it from all players). Returns
false if
the bar doesn’t exist.Source§fn bossbar_set_title(&self, id: &str, title: &str) -> bool
fn bossbar_set_title(&self, id: &str, title: &str) -> bool
Update the displayed title of a boss bar.
Source§fn bossbar_set_progress(&self, id: &str, progress: f32) -> bool
fn bossbar_set_progress(&self, id: &str, progress: f32) -> bool
Set the fill level of a boss bar (0.0 = empty, 1.0 = full).
Source§fn bossbar_set_color(&self, id: &str, color: &str) -> bool
fn bossbar_set_color(&self, id: &str, color: &str) -> bool
Change the color of a boss bar (same color names as [
bossbar_create]).Source§fn bossbar_add_player(&self, id: &str, player: &str) -> bool
fn bossbar_add_player(&self, id: &str, player: &str) -> bool
Add an online player to the boss bar’s audience.
Source§fn bossbar_remove_player(&self, id: &str, player: &str) -> bool
fn bossbar_remove_player(&self, id: &str, player: &str) -> bool
Remove a player from the boss bar’s audience.
Source§fn bossbar_set_visible(&self, id: &str, visible: bool) -> bool
fn bossbar_set_visible(&self, id: &str, visible: bool) -> bool
Show or hide a boss bar for all its current audience members.
Source§fn online_players(&self) -> Vec<String>
fn online_players(&self) -> Vec<String>
Names of all currently connected players.
Source§fn get_block_nbt(&self, dimension: &str, pos: BlockPos) -> Option<String>
fn get_block_nbt(&self, dimension: &str, pos: BlockPos) -> Option<String>
SNBT string of the block entity at
pos (e.g. chest contents, furnace
state, sign text). Returns None if there is no block entity there.Source§fn set_block_nbt(&self, dimension: &str, pos: BlockPos, snbt: &str) -> bool
fn set_block_nbt(&self, dimension: &str, pos: BlockPos, snbt: &str) -> bool
Write
snbt data into the block entity at pos and mark it dirty.
Returns false if there is no block entity at that position.Source§fn get_inventory_slot(
&self,
dimension: &str,
pos: BlockPos,
slot: u32,
) -> Option<(String, u32)>
fn get_inventory_slot( &self, dimension: &str, pos: BlockPos, slot: u32, ) -> Option<(String, u32)>
(item_id, count) of one slot of the inventory-backed block at pos
(see yog_inventory::InventoryDef). Returns None if the slot is
empty, or there is no such inventory at that position.Source§fn set_inventory_slot(
&self,
dimension: &str,
pos: BlockPos,
slot: u32,
item_id: &str,
count: u32,
) -> bool
fn set_inventory_slot( &self, dimension: &str, pos: BlockPos, slot: u32, item_id: &str, count: u32, ) -> bool
Set (or clear when
count == 0) one slot of the inventory-backed
block at pos. Returns false if there is no such inventory there.Source§fn player_inventory(&self, player: &str) -> Vec<(u32, String, u32)>
fn player_inventory(&self, player: &str) -> Vec<(u32, String, u32)>
All occupied inventory slots of an online player.
Returns one entry per occupied slot:
(slot_index, item_id, count).Source§fn player_set_slot(
&self,
player: &str,
slot: u32,
item_id: &str,
count: u32,
) -> bool
fn player_set_slot( &self, player: &str, slot: u32, item_id: &str, count: u32, ) -> bool
Set (or clear when
count == 0) one inventory slot of an online player.Source§fn teleport_to_dim(
&self,
player: &str,
dimension: &str,
x: f64,
y: f64,
z: f64,
) -> bool
fn teleport_to_dim( &self, player: &str, dimension: &str, x: f64, y: f64, z: f64, ) -> bool
Teleport a player to
(x, y, z) in a different (or same) dimension.Source§fn entity_teleport_to_dim(
&self,
uuid: &str,
dimension: &str,
x: f64,
y: f64,
z: f64,
) -> bool
fn entity_teleport_to_dim( &self, uuid: &str, dimension: &str, x: f64, y: f64, z: f64, ) -> bool
Teleport any entity (by UUID) to
(x, y, z) in dimension.Source§fn world_entity_count(&self, dimension: &str, entity_type: &str) -> i32
fn world_entity_count(&self, dimension: &str, entity_type: &str) -> i32
Number of loaded entities of
entity_type (e.g. "minecraft:zombie")
in dimension. Returns -1 if the dimension or entity type is unknown.Source§fn entity_get_nbt(&self, uuid: &str) -> Option<String>
fn entity_get_nbt(&self, uuid: &str) -> Option<String>
SNBT string of the entity’s persistent NBT, or
None if not found.Source§fn entity_set_nbt(&self, uuid: &str, snbt: &str) -> bool
fn entity_set_nbt(&self, uuid: &str, snbt: &str) -> bool
Merge SNBT data into the entity’s persistent NBT. Returns
false if not found.Source§fn spawn_particles(
&self,
dimension: &str,
x: f64,
y: f64,
z: f64,
particle_type: &str,
count: i32,
dx: f64,
dy: f64,
dz: f64,
speed: f64,
) -> bool
fn spawn_particles( &self, dimension: &str, x: f64, y: f64, z: f64, particle_type: &str, count: i32, dx: f64, dy: f64, dz: f64, speed: f64, ) -> bool
Spawn
count particles at (x, y, z) in dimension.
particle_type is a particle id or, like /particle, an id with its
options ("minecraft:dust 1 0.5 0 1").
dx/dy/dz control the spatial spread; speed controls particle velocity.Source§fn entity_attribute_get(&self, uuid: &str, attribute_id: &str) -> Option<f64>
fn entity_attribute_get(&self, uuid: &str, attribute_id: &str) -> Option<f64>
Get the base value of an attribute on a living entity.
attribute_id e.g. "minecraft:generic.max_health".
Returns None if the entity or attribute is not found.Source§fn entity_attribute_set(
&self,
uuid: &str,
attribute_id: &str,
value: f64,
) -> bool
fn entity_attribute_set( &self, uuid: &str, attribute_id: &str, value: f64, ) -> bool
Set the base value of an attribute. Returns false if not found.
Source§fn get_held_item_nbt(&self, player: &str) -> Option<String>
fn get_held_item_nbt(&self, player: &str) -> Option<String>
SNBT string of the item currently held in the player’s main hand.
Returns
None if the player is offline or holding air.Source§fn set_held_item_nbt(&self, player: &str, snbt: &str) -> bool
fn set_held_item_nbt(&self, player: &str, snbt: &str) -> bool
Merge
snbt data into the NBT of the item in the player’s main hand.
Returns false if the player is offline or holding air.Source§fn get_offhand_item_nbt(&self, player: &str) -> Option<String>
fn get_offhand_item_nbt(&self, player: &str) -> Option<String>
SNBT of the item in the player’s off hand.
Returns
None if offline or holding air.Source§fn set_offhand_item_nbt(&self, player: &str, snbt: &str) -> bool
fn set_offhand_item_nbt(&self, player: &str, snbt: &str) -> bool
Merge
snbt into the NBT of the player’s off-hand item.
Returns false if offline or holding air.Source§fn get_slot_item(
&self,
player: &str,
slot: u32,
) -> Option<(String, u32, String)>
fn get_slot_item( &self, player: &str, slot: u32, ) -> Option<(String, u32, String)>
Full item stack at inventory
slot: (item_id, count, nbt_snbt).
nbt_snbt is "{}" when the item has no NBT.
Returns None if the player is offline or the slot is empty.Source§fn set_slot_item(
&self,
player: &str,
slot: u32,
item_id: &str,
count: u32,
snbt: &str,
) -> bool
fn set_slot_item( &self, player: &str, slot: u32, item_id: &str, count: u32, snbt: &str, ) -> bool
Replace inventory
slot. Pass count == 0 to clear the slot.
snbt is merged into the new item’s NBT (pass "" for no NBT).Source§fn entity_info(&self, uuid: &str) -> Option<EntityInfo>
fn entity_info(&self, uuid: &str) -> Option<EntityInfo>
Type, position, size and kind of a loaded entity, or
None if no
entity has that uuid.Source§fn entities_in_box(
&self,
dimension: &str,
min: (f64, f64, f64),
max: (f64, f64, f64),
) -> Vec<String>
fn entities_in_box( &self, dimension: &str, min: (f64, f64, f64), max: (f64, f64, f64), ) -> Vec<String>
Uuids of the entities whose bounding boxes touch the box
min–max
in dimension.Source§fn raycast_block(
&self,
dimension: &str,
from: (f64, f64, f64),
to: (f64, f64, f64),
) -> Option<BlockHit>
fn raycast_block( &self, dimension: &str, from: (f64, f64, f64), to: (f64, f64, f64), ) -> Option<BlockHit>
The first block with a collision shape on the segment
from–to
(fluids are ignored).Source§fn raycast_entity(
&self,
dimension: &str,
from: (f64, f64, f64),
to: (f64, f64, f64),
exclude: &str,
) -> Option<String>
fn raycast_entity( &self, dimension: &str, from: (f64, f64, f64), to: (f64, f64, f64), exclude: &str, ) -> Option<String>
The nearest pickable entity whose (slightly inflated) bounding box the
segment
from–to crosses, other than exclude (a uuid, or "")
and whatever it rides.Source§fn block_info(&self, dimension: &str, pos: BlockPos) -> Option<BlockInfo>
fn block_info(&self, dimension: &str, pos: BlockPos) -> Option<BlockInfo>
State, hardness, fluid and redstone power of the block at
pos.Source§fn break_block(
&self,
dimension: &str,
pos: BlockPos,
drop: bool,
breaker: &str,
) -> bool
fn break_block( &self, dimension: &str, pos: BlockPos, drop: bool, breaker: &str, ) -> bool
Break the block at
pos as breaker (a player name, or ""):
plays the break effects and, if drop, drops its loot as if mined
with an empty hand. Returns false for air and unbreakable blocks.Source§fn place_block_from_slot(
&self,
player: &str,
slot: u32,
dimension: &str,
pos: BlockPos,
) -> bool
fn place_block_from_slot( &self, player: &str, slot: u32, dimension: &str, pos: BlockPos, ) -> bool
Place the block item in the player’s inventory
slot at pos, as if
the player clicked the block below it: the item’s own placement
rules apply and one item is used up (unless creative).Source§fn bonemeal(&self, dimension: &str, pos: BlockPos) -> bool
fn bonemeal(&self, dimension: &str, pos: BlockPos) -> bool
Apply bone meal to the block at
pos. Returns whether it grew.Source§fn explode(
&self,
dimension: &str,
x: f64,
y: f64,
z: f64,
power: f32,
fire: bool,
source: &str,
) -> bool
fn explode( &self, dimension: &str, x: f64, y: f64, z: f64, power: f32, fire: bool, source: &str, ) -> bool
An explosion of
power (TNT is 4) at pos, caused by entity
source (a uuid, or ""); fire sets fires like a ghast fireball.Source§fn tellraw(&self, player: &str, json: &str) -> bool
fn tellraw(&self, player: &str, json: &str) -> bool
A system chat message to one player, like
/tellraw: json is a
JSON text component, so it can hold translation keys
({"translate":"mymod.msg","with":["x"]}) that each client shows in
its own language.Source§fn entity_damage(
&self,
uuid: &str,
amount: f32,
damage_type: &str,
attacker: &str,
) -> bool
fn entity_damage( &self, uuid: &str, amount: f32, damage_type: &str, attacker: &str, ) -> bool
Hurt an entity.
damage_type is a damage type id
("minecraft:magic", "minecraft:drown", …; "" picks one from
the attacker: player attack, mob attack, or magic without one), and
attacker the uuid of the entity responsible (or ""). An unknown
damage type falls back to magic. Returns whether it took the damage.Source§fn entity_set_fire_ticks(&self, uuid: &str, ticks: i32) -> bool
fn entity_set_fire_ticks(&self, uuid: &str, ticks: i32) -> bool
Set an entity on fire for
ticks (0 puts it out).Source§fn player_add_xp(&self, player: &str, amount: i32) -> bool
fn player_add_xp(&self, player: &str, amount: i32) -> bool
Give (or, negative, take) experience points.
Source§fn player_set_may_fly(&self, player: &str, may_fly: bool) -> bool
fn player_set_may_fly(&self, player: &str, may_fly: bool) -> bool
Let a player fly (creative-style) or take it away (also stops them
flying). Game mode changes reset it.
Source§fn player_info(&self, player: &str) -> Option<PlayerInfo>
fn player_info(&self, player: &str) -> Option<PlayerInfo>
Game mode, selected slot, experience, air and flight of a player.
Source§fn spawn_item(
&self,
dimension: &str,
pos: (f64, f64, f64),
vel: (f64, f64, f64),
item_id: &str,
count: u32,
snbt: &str,
) -> Option<String>
fn spawn_item( &self, dimension: &str, pos: (f64, f64, f64), vel: (f64, f64, f64), item_id: &str, count: u32, snbt: &str, ) -> Option<String>
Drop an item stack into the world with velocity
vel; snbt is the
stack’s NBT ("" for none). Returns the item entity’s uuid.Source§fn item_entity_stack(&self, uuid: &str) -> Option<(String, u32, String)>
fn item_entity_stack(&self, uuid: &str) -> Option<(String, u32, String)>
The stack inside a dropped item entity:
(item_id, count, snbt).Source§fn item_entity_set_stack(
&self,
uuid: &str,
item_id: &str,
count: u32,
snbt: &str,
) -> bool
fn item_entity_set_stack( &self, uuid: &str, item_id: &str, count: u32, snbt: &str, ) -> bool
Replace the stack inside a dropped item entity (
count == 0 removes
the entity).Source§fn actionbar_json(&self, player: &str, json: &str) -> bool
fn actionbar_json(&self, player: &str, json: &str) -> bool
An action-bar message (the line above the hotbar) from a JSON text
component, like
tellraw: translation keys show
in each client’s own language.Source§fn use_item_on_block(
&self,
dimension: &str,
pos: BlockPos,
face: Face,
item_id: &str,
player: &str,
) -> bool
fn use_item_on_block( &self, dimension: &str, pos: BlockPos, face: Face, item_id: &str, player: &str, ) -> bool
Use one
item_id (a fresh single item, nothing is taken from anyone)
on the face of the block at pos, as player (a name, or "" for
nobody): flint and steel lights it, a shovel puts out a campfire, a
hoe tills it… Returns whether the item did something.Source§fn pour_fluid(
&self,
dimension: &str,
pos: BlockPos,
bucket_item_id: &str,
) -> bool
fn pour_fluid( &self, dimension: &str, pos: BlockPos, bucket_item_id: &str, ) -> bool
Empty the fluid of a bucket item (
"minecraft:water_bucket") at pos
the way a player would: it waterlogs a waterloggable block, replaces
a replaceable one, and evaporates where water can’t exist. Returns
whether any fluid was placed.Source§fn has_entity_tag(&self, entity_type: &str, tag_id: &str) -> bool
fn has_entity_tag(&self, entity_type: &str, tag_id: &str) -> bool
Whether an entity type (
"minecraft:zombie") is in tag_id
("minecraft:skeletons").Auto Trait Implementations§
impl Freeze for NullServer
impl RefUnwindSafe for NullServer
impl Send for NullServer
impl Sync for NullServer
impl Unpin for NullServer
impl UnsafeUnpin for NullServer
impl UnwindSafe for NullServer
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Returns whether the given value has been niched. Read more
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
Writes data to
out indicating that a T is niched.