Skip to main content

BlockEntitiesServerHost

Trait BlockEntitiesServerHost 

pub trait BlockEntitiesServerHost {
    // Provided method
    fn block_entity_sync(&mut self, pos: [i32; 3]) { ... }
}
Expand description

The server host’s methods of the block_entities area, implemented by the game and reached through ServerHost.

Provided Methods§

fn block_entity_sync(&mut self, pos: [i32; 3])

Side: server. Sends clients the block at pos and its block entity’s update tag (native_block_entity_update_tag) again, as Level.sendBlockUpdated does: with the level’s other block changes, to the players who see its chunk, once however often it is called before then. Changes made in a block entity’s tick go out at the start of the next tick, as vanilla’s do (ServerLevel.tick broadcasts chunks before it ticks block entities). Call it when what clients show changed (a machine started), not for every tick’s progress: a menu’s data slots carry that. Nothing happens for an unloaded block. It also sends the one-shot fields of ModBlockEntityView::set_client_update_fields.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§