pub struct Item<'mc>(/* private fields */);Implementations§
Source§impl<'mc> Item<'mc>
impl<'mc> Item<'mc>
Sourcepub fn item_stack(&self) -> Result<ItemStack<'mc>, Box<dyn Error>>
pub fn item_stack(&self) -> Result<ItemStack<'mc>, Box<dyn Error>>
Gets the item stack associated with this item drop.
Sourcepub fn set_item_stack(
&self,
stack: impl Into<ItemStack<'mc>>,
) -> Result<(), Box<dyn Error>>
pub fn set_item_stack( &self, stack: impl Into<ItemStack<'mc>>, ) -> Result<(), Box<dyn Error>>
Sets the item stack associated with this item drop.
Sourcepub fn pickup_delay(&self) -> Result<i32, Box<dyn Error>>
pub fn pickup_delay(&self) -> Result<i32, Box<dyn Error>>
Gets the delay before this Item is available to be picked up by players
Sourcepub fn set_pickup_delay(&self, delay: i32) -> Result<(), Box<dyn Error>>
pub fn set_pickup_delay(&self, delay: i32) -> Result<(), Box<dyn Error>>
Sets the delay before this Item is available to be picked up by players
Sourcepub fn set_unlimited_lifetime(
&self,
unlimited: bool,
) -> Result<(), Box<dyn Error>>
pub fn set_unlimited_lifetime( &self, unlimited: bool, ) -> Result<(), Box<dyn Error>>
Sets if this Item should live forever
Sourcepub fn is_unlimited_lifetime(&self) -> Result<bool, Box<dyn Error>>
pub fn is_unlimited_lifetime(&self) -> Result<bool, Box<dyn Error>>
Gets if this Item lives forever
Sourcepub fn set_owner(
&self,
owner: impl Into<JavaUUID<'mc>>,
) -> Result<(), Box<dyn Error>>
pub fn set_owner( &self, owner: impl Into<JavaUUID<'mc>>, ) -> Result<(), Box<dyn Error>>
Sets the owner of this item. Other entities will not be able to pickup this item when an owner is set.
Sourcepub fn owner(&self) -> Result<Option<JavaUUID<'mc>>, Box<dyn Error>>
pub fn owner(&self) -> Result<Option<JavaUUID<'mc>>, Box<dyn Error>>
Get the owner of this item.
Sourcepub fn set_thrower(
&self,
uuid: impl Into<JavaUUID<'mc>>,
) -> Result<(), Box<dyn Error>>
pub fn set_thrower( &self, uuid: impl Into<JavaUUID<'mc>>, ) -> Result<(), Box<dyn Error>>
Set the thrower of this item. The thrower is the entity which dropped the item. This affects the trigger criteria for item pickups, for things such as advancements.
Sourcepub fn thrower(&self) -> Result<Option<JavaUUID<'mc>>, Box<dyn Error>>
pub fn thrower(&self) -> Result<Option<JavaUUID<'mc>>, Box<dyn Error>>
Get the thrower of this item. The thrower is the entity which dropped the item.
Sourcepub fn get_location(
&self,
loc: impl Into<Location<'mc>>,
) -> Result<Option<Location<'mc>>, Box<dyn Error>>
pub fn get_location( &self, loc: impl Into<Location<'mc>>, ) -> Result<Option<Location<'mc>>, Box<dyn Error>>
Stores the entity’s current position in the provided Location object.
If the provided Location is null this method does nothing and returns null.
Sourcepub fn set_velocity(
&self,
velocity: impl Into<Vector<'mc>>,
) -> Result<(), Box<dyn Error>>
pub fn set_velocity( &self, velocity: impl Into<Vector<'mc>>, ) -> Result<(), Box<dyn Error>>
Sets this entity’s velocity in meters per tick
Sourcepub fn velocity(&self) -> Result<Vector<'mc>, Box<dyn Error>>
pub fn velocity(&self) -> Result<Vector<'mc>, Box<dyn Error>>
Gets this entity’s current velocity
Sourcepub fn bounding_box(&self) -> Result<BoundingBox<'mc>, Box<dyn Error>>
pub fn bounding_box(&self) -> Result<BoundingBox<'mc>, Box<dyn Error>>
Gets the entity’s current bounding box.
The returned bounding box reflects the entity’s current location and size.
Sourcepub fn is_on_ground(&self) -> Result<bool, Box<dyn Error>>
pub fn is_on_ground(&self) -> Result<bool, Box<dyn Error>>
Returns true if the entity is supported by a block. This value is a state updated by the server and is not recalculated unless the entity moves.
Sourcepub fn is_in_water(&self) -> Result<bool, Box<dyn Error>>
pub fn is_in_water(&self) -> Result<bool, Box<dyn Error>>
Returns true if the entity is in water.
Sourcepub fn world(&self) -> Result<World<'mc>, Box<dyn Error>>
pub fn world(&self) -> Result<World<'mc>, Box<dyn Error>>
Gets the current world this entity resides in
Sourcepub fn set_rotation(&self, yaw: f32, pitch: f32) -> Result<(), Box<dyn Error>>
pub fn set_rotation(&self, yaw: f32, pitch: f32) -> Result<(), Box<dyn Error>>
Sets the entity’s rotation.
Note that if the entity is affected by AI, it may override this rotation.
Sourcepub fn teleport(
&self,
location: impl Into<Location<'mc>>,
cause: Option<impl Into<PlayerTeleportEventTeleportCause<'mc>>>,
) -> Result<bool, Box<dyn Error>>
pub fn teleport( &self, location: impl Into<Location<'mc>>, cause: Option<impl Into<PlayerTeleportEventTeleportCause<'mc>>>, ) -> Result<bool, Box<dyn Error>>
Teleports this entity to the given location. If this entity is riding a vehicle, it will be dismounted prior to teleportation.
Sourcepub fn get_nearby_entities(
&self,
x: f64,
y: f64,
z: f64,
) -> Result<Vec<Entity<'mc>>, Box<dyn Error>>
pub fn get_nearby_entities( &self, x: f64, y: f64, z: f64, ) -> Result<Vec<Entity<'mc>>, Box<dyn Error>>
Returns a list of entities within a bounding box centered around this entity
Sourcepub fn fire_ticks(&self) -> Result<i32, Box<dyn Error>>
pub fn fire_ticks(&self) -> Result<i32, Box<dyn Error>>
Returns the entity’s current fire ticks (ticks before the entity stops being on fire).
Sourcepub fn max_fire_ticks(&self) -> Result<i32, Box<dyn Error>>
pub fn max_fire_ticks(&self) -> Result<i32, Box<dyn Error>>
Returns the entity’s maximum fire ticks.
Sourcepub fn set_fire_ticks(&self, ticks: i32) -> Result<(), Box<dyn Error>>
pub fn set_fire_ticks(&self, ticks: i32) -> Result<(), Box<dyn Error>>
Sets the entity’s current fire ticks (ticks before the entity stops being on fire).
Sourcepub fn set_visual_fire(&self, fire: bool) -> Result<(), Box<dyn Error>>
pub fn set_visual_fire(&self, fire: bool) -> Result<(), Box<dyn Error>>
Sets if the entity has visual fire (it will always appear to be on fire).
Sourcepub fn is_visual_fire(&self) -> Result<bool, Box<dyn Error>>
pub fn is_visual_fire(&self) -> Result<bool, Box<dyn Error>>
Gets if the entity has visual fire (it will always appear to be on fire).
Sourcepub fn freeze_ticks(&self) -> Result<i32, Box<dyn Error>>
pub fn freeze_ticks(&self) -> Result<i32, Box<dyn Error>>
Returns the entity’s current freeze ticks (amount of ticks the entity has been in powdered snow).
Sourcepub fn max_freeze_ticks(&self) -> Result<i32, Box<dyn Error>>
pub fn max_freeze_ticks(&self) -> Result<i32, Box<dyn Error>>
Returns the entity’s maximum freeze ticks (amount of ticks before it will be fully frozen)
Sourcepub fn set_freeze_ticks(&self, ticks: i32) -> Result<(), Box<dyn Error>>
pub fn set_freeze_ticks(&self, ticks: i32) -> Result<(), Box<dyn Error>>
Sets the entity’s current freeze ticks (amount of ticks the entity has been in powdered snow).
Sourcepub fn is_frozen(&self) -> Result<bool, Box<dyn Error>>
pub fn is_frozen(&self) -> Result<bool, Box<dyn Error>>
Gets if the entity is fully frozen (it has been in powdered snow for max freeze ticks).
Sourcepub fn is_dead(&self) -> Result<bool, Box<dyn Error>>
pub fn is_dead(&self) -> Result<bool, Box<dyn Error>>
Returns true if this entity has been marked for removal.
Sourcepub fn is_valid(&self) -> Result<bool, Box<dyn Error>>
pub fn is_valid(&self) -> Result<bool, Box<dyn Error>>
Returns false if the entity has died, been despawned for some other reason, or has not been added to the world.
Sourcepub fn server(&self) -> Result<Server<'mc>, Box<dyn Error>>
pub fn server(&self) -> Result<Server<'mc>, Box<dyn Error>>
Gets the {@link Server} that contains this Entity
Sourcepub fn is_persistent(&self) -> Result<bool, Box<dyn Error>>
pub fn is_persistent(&self) -> Result<bool, Box<dyn Error>>
Returns true if the entity gets persisted.
By default all entities are persistent. An entity will also not get persisted, if it is riding an entity that is not persistent.
The persistent flag on players controls whether or not to save their playerdata file when they quit. If a player is directly or indirectly riding a non-persistent entity, the vehicle at the root and all its passengers won’t get persisted.
This should not be confused with {@link LivingEntity#setRemoveWhenFarAway(boolean)} which controls despawning of living entities.
Sourcepub fn set_persistent(&self, persistent: bool) -> Result<(), Box<dyn Error>>
pub fn set_persistent(&self, persistent: bool) -> Result<(), Box<dyn Error>>
Sets whether or not the entity gets persisted.
Sourcepub fn passenger(&self) -> Result<Option<Entity<'mc>>, Box<dyn Error>>
👎Deprecated
pub fn passenger(&self) -> Result<Option<Entity<'mc>>, Box<dyn Error>>
Gets the primary passenger of a vehicle. For vehicles that could have multiple passengers, this will only return the primary passenger.
Sourcepub fn set_passenger(
&self,
passenger: impl Into<Entity<'mc>>,
) -> Result<bool, Box<dyn Error>>
👎Deprecated
pub fn set_passenger( &self, passenger: impl Into<Entity<'mc>>, ) -> Result<bool, Box<dyn Error>>
Set the passenger of a vehicle.
Sourcepub fn passengers(&self) -> Result<Vec<Entity<'mc>>, Box<dyn Error>>
pub fn passengers(&self) -> Result<Vec<Entity<'mc>>, Box<dyn Error>>
Gets a list of passengers of this vehicle.
The returned list will not be directly linked to the entity’s current passengers, and no guarantees are made as to its mutability.
Sourcepub fn add_passenger(
&self,
passenger: impl Into<Entity<'mc>>,
) -> Result<bool, Box<dyn Error>>
pub fn add_passenger( &self, passenger: impl Into<Entity<'mc>>, ) -> Result<bool, Box<dyn Error>>
Add a passenger to the vehicle.
Sourcepub fn remove_passenger(
&self,
passenger: impl Into<Entity<'mc>>,
) -> Result<bool, Box<dyn Error>>
pub fn remove_passenger( &self, passenger: impl Into<Entity<'mc>>, ) -> Result<bool, Box<dyn Error>>
Remove a passenger from the vehicle.
Sourcepub fn fall_distance(&self) -> Result<f32, Box<dyn Error>>
pub fn fall_distance(&self) -> Result<f32, Box<dyn Error>>
Returns the distance this entity has fallen
Sourcepub fn set_fall_distance(&self, distance: f32) -> Result<(), Box<dyn Error>>
pub fn set_fall_distance(&self, distance: f32) -> Result<(), Box<dyn Error>>
Sets the fall distance for this entity
Sourcepub fn set_last_damage_cause(
&self,
event: impl Into<EntityDamageEvent<'mc>>,
) -> Result<(), Box<dyn Error>>
👎Deprecated
pub fn set_last_damage_cause( &self, event: impl Into<EntityDamageEvent<'mc>>, ) -> Result<(), Box<dyn Error>>
Record the last {@link EntityDamageEvent} inflicted on this entity
Sourcepub fn last_damage_cause(
&self,
) -> Result<Option<EntityDamageEvent<'mc>>, Box<dyn Error>>
pub fn last_damage_cause( &self, ) -> Result<Option<EntityDamageEvent<'mc>>, Box<dyn Error>>
Retrieve the last {@link EntityDamageEvent} inflicted on this entity. This event may have been cancelled.
Sourcepub fn unique_id(&self) -> Result<JavaUUID<'mc>, Box<dyn Error>>
pub fn unique_id(&self) -> Result<JavaUUID<'mc>, Box<dyn Error>>
Returns a unique and persistent id for this entity
Sourcepub fn ticks_lived(&self) -> Result<i32, Box<dyn Error>>
pub fn ticks_lived(&self) -> Result<i32, Box<dyn Error>>
Gets the amount of ticks this entity has lived for.
This is the equivalent to “age” in entities.
Sourcepub fn set_ticks_lived(&self, value: i32) -> Result<(), Box<dyn Error>>
pub fn set_ticks_lived(&self, value: i32) -> Result<(), Box<dyn Error>>
Sets the amount of ticks this entity has lived for.
This is the equivalent to “age” in entities. May not be less than one tick.
Sourcepub fn play_effect(
&self,
val_type: impl Into<EntityEffect<'mc>>,
) -> Result<(), Box<dyn Error>>
pub fn play_effect( &self, val_type: impl Into<EntityEffect<'mc>>, ) -> Result<(), Box<dyn Error>>
Performs the specified {@link EntityEffect} for this entity.
This will be viewable to all players near the entity.
If the effect is not applicable to this class of entity, it will not play.
Sourcepub fn swim_sound(&self) -> Result<Sound<'mc>, Box<dyn Error>>
pub fn swim_sound(&self) -> Result<Sound<'mc>, Box<dyn Error>>
Get the {@link Sound} this entity makes while swimming.
Sourcepub fn swim_splash_sound(&self) -> Result<Sound<'mc>, Box<dyn Error>>
pub fn swim_splash_sound(&self) -> Result<Sound<'mc>, Box<dyn Error>>
Get the {@link Sound} this entity makes when splashing in water. For most entities, this is just {@link Sound#ENTITY_GENERIC_SPLASH}.
Sourcepub fn swim_high_speed_splash_sound(&self) -> Result<Sound<'mc>, Box<dyn Error>>
pub fn swim_high_speed_splash_sound(&self) -> Result<Sound<'mc>, Box<dyn Error>>
Get the {@link Sound} this entity makes when splashing in water at high speeds. For most entities, this is just {@link Sound#ENTITY_GENERIC_SPLASH}.
Sourcepub fn is_inside_vehicle(&self) -> Result<bool, Box<dyn Error>>
pub fn is_inside_vehicle(&self) -> Result<bool, Box<dyn Error>>
Returns whether this entity is inside a vehicle.
Sourcepub fn leave_vehicle(&self) -> Result<bool, Box<dyn Error>>
pub fn leave_vehicle(&self) -> Result<bool, Box<dyn Error>>
Leave the current vehicle. If the entity is currently in a vehicle (and is removed from it), true will be returned, otherwise false will be returned.
Sourcepub fn vehicle(&self) -> Result<Option<Entity<'mc>>, Box<dyn Error>>
pub fn vehicle(&self) -> Result<Option<Entity<'mc>>, Box<dyn Error>>
Get the vehicle that this entity is inside. If there is no vehicle, null will be returned.
Sourcepub fn set_custom_name_visible(&self, flag: bool) -> Result<(), Box<dyn Error>>
pub fn set_custom_name_visible(&self, flag: bool) -> Result<(), Box<dyn Error>>
Sets whether or not to display the mob’s custom name client side. The name will be displayed above the mob similarly to a player.
This value has no effect on players, they will always display their name.
Sourcepub fn is_custom_name_visible(&self) -> Result<bool, Box<dyn Error>>
pub fn is_custom_name_visible(&self) -> Result<bool, Box<dyn Error>>
Gets whether or not the mob’s custom name is displayed client side.
This value has no effect on players, they will always display their name.
Sourcepub fn set_visible_by_default(
&self,
visible: bool,
) -> Result<(), Box<dyn Error>>
pub fn set_visible_by_default( &self, visible: bool, ) -> Result<(), Box<dyn Error>>
Sets whether or not this entity is visible by default. If this entity is not visible by default, then {@link Player#showEntity(org.bukkit.plugin.Plugin, org.bukkit.entity.Entity)} will need to be called before the entity is visible to a given player.
Sourcepub fn is_visible_by_default(&self) -> Result<bool, Box<dyn Error>>
pub fn is_visible_by_default(&self) -> Result<bool, Box<dyn Error>>
Gets whether or not this entity is visible by default. If this entity is not visible by default, then {@link Player#showEntity(org.bukkit.plugin.Plugin, org.bukkit.entity.Entity)} will need to be called before the entity is visible to a given player.
Sourcepub fn tracked_by(&self) -> Result<JavaSet<'mc>, Box<dyn Error>>
pub fn tracked_by(&self) -> Result<JavaSet<'mc>, Box<dyn Error>>
Get all players that are currently tracking this entity.
‘Tracking’ means that this entity has been sent to the player and that they are receiving updates on its state. Note that the client’s {@code ‘Entity Distance’} setting does not affect the range at which entities are tracked.
Sourcepub fn set_glowing(&self, flag: bool) -> Result<(), Box<dyn Error>>
pub fn set_glowing(&self, flag: bool) -> Result<(), Box<dyn Error>>
Sets whether the entity has a team colored (default: white) glow. nb: this refers to the ‘Glowing’ entity property, not whether a glowing potion effect is applied
Sourcepub fn is_glowing(&self) -> Result<bool, Box<dyn Error>>
pub fn is_glowing(&self) -> Result<bool, Box<dyn Error>>
Gets whether the entity is glowing or not. nb: this refers to the ‘Glowing’ entity property, not whether a glowing potion effect is applied
Sourcepub fn set_invulnerable(&self, flag: bool) -> Result<(), Box<dyn Error>>
pub fn set_invulnerable(&self, flag: bool) -> Result<(), Box<dyn Error>>
Sets whether the entity is invulnerable or not.
When an entity is invulnerable it can only be damaged by players in creative mode.
Sourcepub fn is_invulnerable(&self) -> Result<bool, Box<dyn Error>>
pub fn is_invulnerable(&self) -> Result<bool, Box<dyn Error>>
Gets whether the entity is invulnerable or not.
Sourcepub fn is_silent(&self) -> Result<bool, Box<dyn Error>>
pub fn is_silent(&self) -> Result<bool, Box<dyn Error>>
Gets whether the entity is silent or not.
Sourcepub fn set_silent(&self, flag: bool) -> Result<(), Box<dyn Error>>
pub fn set_silent(&self, flag: bool) -> Result<(), Box<dyn Error>>
Sets whether the entity is silent or not.
When an entity is silent it will not produce any sound.
Sourcepub fn has_gravity(&self) -> Result<bool, Box<dyn Error>>
pub fn has_gravity(&self) -> Result<bool, Box<dyn Error>>
Returns whether gravity applies to this entity.
Sourcepub fn set_gravity(&self, gravity: bool) -> Result<(), Box<dyn Error>>
pub fn set_gravity(&self, gravity: bool) -> Result<(), Box<dyn Error>>
Sets whether gravity applies to this entity.
Sourcepub fn portal_cooldown(&self) -> Result<i32, Box<dyn Error>>
pub fn portal_cooldown(&self) -> Result<i32, Box<dyn Error>>
Gets the period of time (in ticks) before this entity can use a portal.
Sourcepub fn set_portal_cooldown(&self, cooldown: i32) -> Result<(), Box<dyn Error>>
pub fn set_portal_cooldown(&self, cooldown: i32) -> Result<(), Box<dyn Error>>
Sets the period of time (in ticks) before this entity can use a portal.
Returns a set of tags for this entity.
Entities can have no more than 1024 tags.
Sourcepub fn add_scoreboard_tag(
&self,
tag: impl Into<String>,
) -> Result<bool, Box<dyn Error>>
pub fn add_scoreboard_tag( &self, tag: impl Into<String>, ) -> Result<bool, Box<dyn Error>>
Add a tag to this entity.
Entities can have no more than 1024 tags.
Sourcepub fn remove_scoreboard_tag(
&self,
tag: impl Into<String>,
) -> Result<bool, Box<dyn Error>>
pub fn remove_scoreboard_tag( &self, tag: impl Into<String>, ) -> Result<bool, Box<dyn Error>>
Removes a given tag from this entity.
Sourcepub fn piston_move_reaction(
&self,
) -> Result<PistonMoveReaction<'mc>, Box<dyn Error>>
pub fn piston_move_reaction( &self, ) -> Result<PistonMoveReaction<'mc>, Box<dyn Error>>
Returns the reaction of the entity when moved by a piston.
Sourcepub fn facing(&self) -> Result<BlockFace<'mc>, Box<dyn Error>>
pub fn facing(&self) -> Result<BlockFace<'mc>, Box<dyn Error>>
Get the closest cardinal {@link BlockFace} direction an entity is currently facing.
This will not return any non-cardinal directions such as {@link BlockFace#UP} or {@link BlockFace#DOWN}.
{@link Hanging} entities will override this call and thus their behavior may be different.
Sourcepub fn pose(&self) -> Result<Pose<'mc>, Box<dyn Error>>
pub fn pose(&self) -> Result<Pose<'mc>, Box<dyn Error>>
Gets the entity’s current pose. Note that the pose is only updated at the end of a tick, so may be inconsistent with other methods. eg {@link Player#isSneaking()} being true does not imply the current pose will be {@link Pose#SNEAKING}
Sourcepub fn spawn_category(&self) -> Result<SpawnCategory<'mc>, Box<dyn Error>>
pub fn spawn_category(&self) -> Result<SpawnCategory<'mc>, Box<dyn Error>>
Get the category of spawn to which this entity belongs.
Sourcepub fn is_in_world(&self) -> Result<bool, Box<dyn Error>>
pub fn is_in_world(&self) -> Result<bool, Box<dyn Error>>
Checks if this entity has been spawned in a world.
Entities not spawned in a world will not tick, be sent to players, or be saved to the server files.
Sourcepub fn as_string(&self) -> Result<Option<String>, Box<dyn Error>>
pub fn as_string(&self) -> Result<Option<String>, Box<dyn Error>>
Get this entity as an NBT string.
This string should not be relied upon as a serializable value.
Sourcepub fn create_snapshot(
&self,
) -> Result<Option<EntitySnapshot<'mc>>, Box<dyn Error>>
pub fn create_snapshot( &self, ) -> Result<Option<EntitySnapshot<'mc>>, Box<dyn Error>>
Crates an {@link EntitySnapshot} representing the current state of this entity.
Sourcepub fn copy(
&self,
to: Option<impl Into<Location<'mc>>>,
) -> Result<Entity<'mc>, Box<dyn Error>>
pub fn copy( &self, to: Option<impl Into<Location<'mc>>>, ) -> Result<Entity<'mc>, Box<dyn Error>>
Creates a copy of this entity and all its data. Spawns the copy at the given location.
Note: Players cannot be copied.
Sourcepub fn set_metadata(
&self,
metadata_key: impl Into<String>,
new_metadata_value: impl Into<MetadataValue<'mc>>,
) -> Result<(), Box<dyn Error>>
pub fn set_metadata( &self, metadata_key: impl Into<String>, new_metadata_value: impl Into<MetadataValue<'mc>>, ) -> Result<(), Box<dyn Error>>
Sets a metadata value in the implementing object’s metadata store.
Sourcepub fn get_metadata(
&self,
metadata_key: impl Into<String>,
) -> Result<Vec<MetadataValue<'mc>>, Box<dyn Error>>
pub fn get_metadata( &self, metadata_key: impl Into<String>, ) -> Result<Vec<MetadataValue<'mc>>, Box<dyn Error>>
Returns a list of previously set metadata values from the implementing object’s metadata store.
Sourcepub fn has_metadata(
&self,
metadata_key: impl Into<String>,
) -> Result<bool, Box<dyn Error>>
pub fn has_metadata( &self, metadata_key: impl Into<String>, ) -> Result<bool, Box<dyn Error>>
Tests to see whether the implementing object contains the given metadata value in its metadata store.
Sourcepub fn remove_metadata(
&self,
metadata_key: impl Into<String>,
owning_plugin: impl Into<Plugin<'mc>>,
) -> Result<(), Box<dyn Error>>
pub fn remove_metadata( &self, metadata_key: impl Into<String>, owning_plugin: impl Into<Plugin<'mc>>, ) -> Result<(), Box<dyn Error>>
Removes the given metadata value from the implementing object’s metadata store.
Sourcepub fn send_message(
&self,
sender: impl Into<JavaUUID<'mc>>,
messages: Option<impl Into<String>>,
) -> Result<(), Box<dyn Error>>
pub fn send_message( &self, sender: impl Into<JavaUUID<'mc>>, messages: Option<impl Into<String>>, ) -> Result<(), Box<dyn Error>>
Sends this sender multiple messages
Sourcepub fn custom_name(&self) -> Result<Option<String>, Box<dyn Error>>
pub fn custom_name(&self) -> Result<Option<String>, Box<dyn Error>>
Gets the custom name on a mob or block. If there is no name this method will return null.
This value has no effect on players, they will always use their real name.
Sourcepub fn set_custom_name(
&self,
name: impl Into<String>,
) -> Result<(), Box<dyn Error>>
pub fn set_custom_name( &self, name: impl Into<String>, ) -> Result<(), Box<dyn Error>>
Sets a custom name on a mob or block. This name will be used in death messages and can be sent to the client as a nameplate over the mob.
Setting the name to null or an empty string will clear it.
This value has no effect on players, they will always use their real name.
Sourcepub fn persistent_data_container(
&self,
) -> Result<PersistentDataContainer<'mc>, Box<dyn Error>>
pub fn persistent_data_container( &self, ) -> Result<PersistentDataContainer<'mc>, Box<dyn Error>>
Returns a custom tag container capable of storing tags on the object. Note that the tags stored on this container are all stored under their own custom namespace therefore modifying default tags using this {@link PersistentDataHolder} is impossible.
pub fn instance_of(&self, other: impl Into<String>) -> Result<bool, Error>
Trait Implementations§
Source§impl<'mc> JNIInstantiatable<'mc> for Item<'mc>
impl<'mc> JNIInstantiatable<'mc> for Item<'mc>
Auto Trait Implementations§
impl<'mc> !Freeze for Item<'mc>
impl<'mc> !RefUnwindSafe for Item<'mc>
impl<'mc> !Send for Item<'mc>
impl<'mc> !Sync for Item<'mc>
impl<'mc> Unpin for Item<'mc>
impl<'mc> UnwindSafe for Item<'mc>
Blanket Implementations§
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read more