#[repr(u8)]pub enum Difficulty {
Peaceful = 0,
Easy = 1,
Normal = 2,
Hard = 3,
}Expand description
World difficulty level.
Controls starvation damage thresholds, mob spawning behavior, and various other gameplay tweaks.
Variants§
Peaceful = 0
No hostile mobs, no starvation, health regenerates quickly.
Easy = 1
Hostile mobs deal less damage, starvation stops at 10 HP.
Normal = 2
Default difficulty, starvation stops at 1 HP.
Hard = 3
Hostile mobs deal more damage, starvation can kill.
Trait Implementations§
Source§impl Clone for Difficulty
impl Clone for Difficulty
Source§fn clone(&self) -> Difficulty
fn clone(&self) -> Difficulty
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 moreimpl Copy for Difficulty
Source§impl Debug for Difficulty
impl Debug for Difficulty
Source§impl Default for Difficulty
impl Default for Difficulty
Source§fn default() -> Difficulty
fn default() -> Difficulty
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for Difficulty
impl<'de> Deserialize<'de> for Difficulty
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Difficulty
Source§impl From<Difficulty> for u8
impl From<Difficulty> for u8
Source§fn from(value: Difficulty) -> Self
fn from(value: Difficulty) -> Self
Converts to this type from the input type.
Source§impl From<u8> for Difficulty
impl From<u8> for Difficulty
Source§impl Hash for Difficulty
impl Hash for Difficulty
Source§impl PartialEq for Difficulty
impl PartialEq for Difficulty
Source§fn eq(&self, other: &Difficulty) -> bool
fn eq(&self, other: &Difficulty) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl ReadFrom for Difficulty
impl ReadFrom for Difficulty
Source§impl Serialize for Difficulty
impl Serialize for Difficulty
impl StructuralPartialEq for Difficulty
Auto Trait Implementations§
impl Freeze for Difficulty
impl RefUnwindSafe for Difficulty
impl Send for Difficulty
impl Sync for Difficulty
impl Unpin for Difficulty
impl UnsafeUnpin for Difficulty
impl UnwindSafe for Difficulty
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.