Struct MinecartRef
pub struct MinecartRef(/* private fields */);Expand description
A vanilla AbstractMinecart, narrowed from an entity with host.minecart(entity).
Implementations§
§impl MinecartRef
impl MinecartRef
pub fn push(self, host: &dyn Host) -> Option<[f64; 3]>
pub fn push(self, host: &dyn Host) -> Option<[f64; 3]>
Side: server.
A furnace minecart’s push (MinecartFurnace.push): the way its fuel drives it on rails,
x and z; its y part stays between ticks and sets the push’s length. None for another
kind of cart.
pub fn kind(self, host: &dyn Host) -> Option<MinecartKind>
pub fn kind(self, host: &dyn Host) -> Option<MinecartKind>
Side: server.
Which AbstractMinecart subclass the cart is.
pub fn max_speed(self, host: &dyn Host) -> Option<f64>
pub fn max_speed(self, host: &dyn Host) -> Option<f64>
Side: server.
AbstractMinecart.getMaxSpeed, in blocks per tick: the old behaviour’s
0.4 (0.2 in water), or with the minecart_improvements experiment the
max_minecart_speed rule over 20 (halved in water). A furnace minecart
takes half of that, three quarters in water (MinecartFurnace).
pub fn is_on_rails(self, host: &dyn Host) -> Option<bool>
pub fn is_on_rails(self, host: &dyn Host) -> Option<bool>
Side: server.
AbstractMinecart.isOnRails.
pub fn damage(self, host: &dyn Host) -> Option<f32>
pub fn damage(self, host: &dyn Host) -> Option<f32>
Side: server.
VehicleEntity.getDamage, the wobble damage (DATA_ID_DAMAGE).
pub fn hurt_time(self, host: &dyn Host) -> Option<i32>
pub fn hurt_time(self, host: &dyn Host) -> Option<i32>
Side: server.
VehicleEntity.getHurtTime, the wobble ticks (DATA_ID_HURT).
pub fn custom_display_block(self, host: &dyn Host) -> Option<Option<BlockState>>
pub fn custom_display_block(self, host: &dyn Host) -> Option<Option<BlockState>>
Side: server.
AbstractMinecart.customDisplayBlockState: the block the cart shows in
place of its kind’s default, None (inner) when it has none.
pub fn display_offset(self, host: &dyn Host) -> Option<i32>
pub fn display_offset(self, host: &dyn Host) -> Option<i32>
Side: server.
AbstractMinecart.getDisplayOffset, in sixteenths of a block: the set
offset, else the kind’s default.
pub fn fuel(self, host: &dyn Host) -> Option<i32>
pub fn fuel(self, host: &dyn Host) -> Option<i32>
Side: server.
MinecartFurnace’s fuel ticks; None for another kind of cart.
pub fn fuse(self, host: &dyn Host) -> Option<i32>
pub fn fuse(self, host: &dyn Host) -> Option<i32>
Side: server.
MinecartTNT’s fuse ticks, -1 when it is not primed; None for another
kind of cart.
pub fn hopper_enabled(self, host: &dyn Host) -> Option<bool>
pub fn hopper_enabled(self, host: &dyn Host) -> Option<bool>
Side: server.
MinecartHopper.isEnabled; None for another kind of cart.
pub fn command(self, host: &dyn Host) -> Option<String>
pub fn command(self, host: &dyn Host) -> Option<String>
Side: server.
A command block minecart’s command (MinecartCommandBlock.getCommandBlock().getCommand()).
None for another kind of cart.
pub fn set_push(self, host: &mut dyn ServerHost, push: [f64; 3]) -> bool
pub fn set_push(self, host: &mut dyn ServerHost, push: [f64; 3]) -> bool
Side: server.
Sets a furnace minecart’s push, as a player’s click with fuel sets it toward them
(MinecartFurnace.interact): a cart a mod drives runs that way while it has fuel. False
for another kind of cart or a push that isn’t finite.
pub fn set_flipped(self, host: &mut dyn ServerHost, flipped: bool) -> bool
pub fn set_flipped(self, host: &mut dyn ServerHost, flipped: bool) -> bool
Side: server.
AbstractMinecart.setFlipped; saved as FlippedRotation, not synced.
pub fn set_damage(self, host: &mut dyn ServerHost, damage: f32) -> bool
pub fn set_damage(self, host: &mut dyn ServerHost, damage: f32) -> bool
Side: server.
VehicleEntity.setDamage: synced to clients. The tick counts it down
only while positive.
pub fn set_hurt_time(self, host: &mut dyn ServerHost, ticks: i32) -> bool
pub fn set_hurt_time(self, host: &mut dyn ServerHost, ticks: i32) -> bool
Side: server.
VehicleEntity.setHurtTime: synced to clients.
pub fn set_custom_display_block(
self,
host: &mut dyn ServerHost,
state: Option<BlockState>,
) -> bool
pub fn set_custom_display_block( self, host: &mut dyn ServerHost, state: Option<BlockState>, ) -> bool
Side: server.
Sets the block the cart shows, or with None its kind’s default again:
saved as DisplayState and synced to clients. False for a state the
registry doesn’t know, as the loader drops one that does not decode.
pub fn set_display_offset(self, host: &mut dyn ServerHost, offset: i32) -> bool
pub fn set_display_offset(self, host: &mut dyn ServerHost, offset: i32) -> bool
Side: server.
AbstractMinecart.setDisplayOffset, in sixteenths of a block: saved as
DisplayOffset (only off the kind’s default) and synced to clients.
pub fn set_fuel(self, host: &mut dyn ServerHost, fuel: i32) -> bool
pub fn set_fuel(self, host: &mut dyn ServerHost, fuel: i32) -> bool
Side: server.
Sets a furnace minecart’s fuel ticks, any int as vanilla’s field holds
it (saved as a short, the low 16 bits). False for another kind of cart.
The lit flag (DATA_ID_FUEL) follows with fuel above zero.
pub fn prime_fuse(self, host: &mut dyn ServerHost) -> bool
pub fn prime_fuse(self, host: &mut dyn ServerHost) -> bool
Side: server.
MinecartTNT.primeFuse(null): an 80 tick fuse, the primed sound and
entity event 70 for clients. False for another kind of cart, or with
the tnt_explodes rule off.
pub fn set_hopper_enabled(
self,
host: &mut dyn ServerHost,
enabled: bool,
) -> bool
pub fn set_hopper_enabled( self, host: &mut dyn ServerHost, enabled: bool, ) -> bool
Side: server.
MinecartHopper.setEnabled: saved as Enabled, not synced.
pub fn set_command(self, host: &mut dyn ServerHost, command: &str) -> bool
pub fn set_command(self, host: &mut dyn ServerHost, command: &str) -> bool
Side: server.
Sets a command block minecart’s command (BaseCommandBlock.setCommand, which resets the
success count), then MinecartCommandBase.onUpdated, as the edit screen’s save does: the
synced command and last output follow, so clients’ editors show the new command. The
output and its tracking are kept, and no chat note is sent. An activator rail then runs
the new command. False for another kind of cart.
§impl MinecartRef
impl MinecartRef
Trait Implementations§
§impl Clone for MinecartRef
impl Clone for MinecartRef
§fn clone(&self) -> MinecartRef
fn clone(&self) -> MinecartRef
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more