Expand description
Contains the most frequently used items in Valence projects.
This is usually glob imported like so:
use valence::prelude::*; // Glob import.
let mut app = App::new();
app.add_systems(Update, || println!("yippee!"));
// ...
Re-exports
pub use valence_server::message::SendMessage as _;
pub use valence_server::title::SetTitle as _;
pub use super::DefaultPlugins;
pub use bevy_ecs;
pub use valence_server::ident;
Modules
- system_adapterDeprecatedA collection of common adapters for piping the result of a system.
Macros
- Creates a new
Ident
at compile time from a string literal. A compile error is raised if the string is not a valid resource identifier.
Structs
- A filter on a component that only retains results added after the system last ran.
- Advancement’s id. May not be updated.
- Components for advancement that are required Optional components: AdvancementDisplay [Parent] - parent advancement
- Criteria’s identifier. May not be updated
- Advancement display. Optional component
- Requirements for advancement to be completed. All columns should be completed, column is completed when any of criteria in this column is completed.
- This event sends when the client changes or closes advancement’s tab.
- The
AnyOf
query parameter fetches entities with any of the component types included in T. - A container of app logic and data.
- A
Resource
storingTypeRegistry
for type registrations relevant to a whole app. - Represents a complete block, which is a pair of block state and optional NBT data for the block entity.
- Represents an absolute block position in world space.
- Like
Block
, but immutably referenced. - Represents the state of a block. This does not include block entity data such as the text on a sign, the design on a banner, or the content of a spawner.
- A filter on a component that only retains results added or mutably dereferenced after the system last ran.
- The X and Z position of a chunk.
- Represents the set of all chunk positions that a client can see, defined by a center chunk position
pos
and view distancedist
. - The main client component. Contains the underlying network connection and packet buffer.
- A convenient
WorldQuery
for obtaining client spawn components. Also seeClientSpawnQueryReadOnly
. - Automatically generated
WorldQuery
type for a read-only variant ofClientSpawnQuery
. - The item stack that the client thinks it’s holding under the mouse cursor.
- A 2-dimensional vector.
- A 3-dimensional vector.
- A
SystemParam
that stores a buffer which gets applied to theWorld
duringapply_deferred
. This is used internally byCommands
to deferWorld
mutations. - A marker
Component
for entities that should be despawned at the end of the tick. - Lightweight identifier of an entity.
- Identifies the type of an entity. As a component, the entity kind should not be modified.
- A
Component
containing Minecraft entities. - Contains the entity layer an entity is on.
- A
Resource
which maintains information about all spawned Minecraft entities. - Provides mutable access to a single entity and all of its components.
- A read-only reference to a particular
Entity
and all of its components. - A mutable reference to a particular
Entity
, and the entire world. This is essentially a performance-optimized(Entity, &mut World)
tuple, which caches theEntityLocation
to reduce duplicate lookups. - A type-erased wrapper around an
NetworkCallbacks
object. - Reads events of type
T
in order and tracks which events have already been read. - Sends events of type
T
. - An event collection that represents the events that occurred within the last two
Events::update
calls. Events can be written to using anEventWriter
and are typically cheaply read using anEventReader
. - Runs first in the schedule. This is run by the
Main
schedule. - The schedule that contains systems which only run after a fixed period of time has elapsed.
- Returns a bool that describes if an entity has the component
T
. - Size of hitbox. The only way to manipulate it without losing it on the next tick is using a marker entity. Marker entity’s hitbox is never updated.
- A wrapper around a string type
S
which guarantees the wrapped string is a valid resource identifier. - Wrapper type to mark a
SystemParam
as an input. - A helper to represent the inventory window that the player is currently viewing. Handles dispatching reads to the correct inventory.
- A helper to represent the inventory window that the player is currently viewing. Handles dispatching reads/writes to the correct inventory.
- A stack of items in an inventory.
- Runs last in the schedule. This is run by the
Main
schedule. - A system local
SystemParam
. - Describes the direction an entity is looking using pitch and yaw angles.
- The schedule that contains the app logic that is evaluated each tick of
App::update()
. - Unique mutable borrow of an entity’s component
- Settings for
NetworkPlugin
. Note that mutations to these fields have no effect after the plugin is built. - Contains information about a new client joining the server.
- The next state of
State<S>
. - Shared borrow of a non-
Send
resource. - Unique borrow of a non-
Send
resource. - The value of
EntityLayerId
from the end of the previous tick. - The value of
Position
from the end of the previous tick. - The
ViewDistance
at the end of the previous tick. Automatically updated asViewDistance
is changed. - Used to indicate that the client with this component is currently viewing an inventory.
- A filter that tests if any of the given filters apply.
- An alternative to
Commands
that can be used in parallel contexts, such as those inQuery::par_iter
- A collection of potentially conflicting
SystemParam
s allowed by disjoint access. - Marker component for player list entries.
- The schedule that contains logic that must run after
Update
. For example, synchronizing “local transforms” in a hierarchy to “global” absolute transforms. This enables thePostUpdate
transform-sync system to react to “local transform” changes inUpdate
without theUpdate
systems needing to know about (or add scheduler dependencies for) the “global transform sync system”. - The schedule that contains logic that must run before
Update
. For example, a system that reads raw keyboard input OS events into anEvents
resource. This enables systems inUpdate
to consume the events from theEvents
resource without actually knowing about (or taking a direct scheduler dependency on) the “os-level keyboard event system”. - Player properties from the game profile.
- Provides scoped access to a
World
state according to a givenWorldQuery
and query filter. - Shared borrow of an entity’s component with access to change detection. Similar to
Mut
but is immutable and so doesn’t require unique access. - A struct used to operate on reflected
Component
of a type. - A struct used to operate on reflected
Resource
of a type. - Shared borrow of a
Resource
. - Unique mutable borrow of a
Resource
. - The position and angle that clients will respawn with. Also controls the position that compasses point towards.
- A collection of systems, and the metadata and executor needed to run them in a certain order under certain conditions.
- Resource that stores
Schedule
s mapped toScheduleLabel
s. - Contains global server state accessible as a
Resource
. - The schedule that contains scene spawning. This is run by the
Main
schedule. - The schedule that runs once when the app starts. This is run by the
Main
schedule. - A finite-state machine whose transitions have associated schedules ([
OnEnter(state)
] and [OnExit(state)
]). - Runs state transitions. This is run by the
Main
schedule. - Represents formatted text in Minecraft’s JSON text format.
- The universally unique identifier of an entity. Component wrapper for a
Uuid
. - The schedule that contains app logic. This is run by the
Main
schedule. - A Universally Unique Identifier (UUID).
- A 2-dimensional vector.
- A 3-dimensional vector.
- A
Component
containing a handle to theChunkLayer
a client can see. - A
Component
containing the set ofEntityLayer
s a client can see. All Minecraft entities from all layers in this set are potentially visible to the client. - Filter that selects entities with a component
T
. - Filter that selects entities without a component
T
. - Stores and exposes operations on entities, components, resources, and their associated metadata.
Enums
- An enumeration of all block kinds.
- Text color
- Describes how new connections to the server are handled.
- Represents an item from the game
- Contains all possible block state property names.
- Contains all possible values that a block property might have.
Traits
- The
Bundle
trait enables insertion and removal ofComponent
s from an entity. - Common operations on chunks. Notable implementors are
LoadedChunk
andUnloadedChunk
. - A data type that can be used to store data for an entity.
- A system that determines if one or more scheduled systems should run.
- Types that can read change detection information. This change detection is controlled by
DetectChangesMut
types such asResMut
. - Types that implement reliable change detection.
- A type that can be stored in an
Events<E>
resource You can conveniently access events using theEventReader
andEventWriter
system parameter. - Creates an instance of the type this trait is implemented for using data from the supplied
World
. - Conversion trait to turn something into a
System
. - Types that can convert into a
SystemConfigs
. - Types that can be converted into a
SystemSet
. - Types that can convert into a
SystemSetConfigs
. - Trait for any data that can be converted to a
Text
object. - This trait uses
async_trait
. - A collection of Bevy app logic and configuration.
- Combines multiple
Plugin
s into a single unit. System
types that do not modify theWorld
when run. This is implemented for any systems whose parameters all implementReadOnlySystemParam
.- A type that can be inserted into a
World
as a singleton. - Types that can define world-wide states in a finite-state machine.
- An ECS system that can be added to a
Schedule
- A trait implemented for all functions that can be used as
System
s. - Types that identify logical groups of systems.
Functions
- Generates a
Condition
-satisfying closure that returnstrue
if there are any entity with a component of the given type removed. - Generates a
Condition
-satisfying closure that returnstrue
if there are any entities with the given component type. - Instructs the executor to call
System::apply_deferred
on the systems that have run but not applied theirDeferred
system parameters (likeCommands
) or other system buffers. - If a new state is queued in
NextState<S>
, this system: - dbgDeprecatedSystem adapter that utilizes the [
bevy_utils::tracing::debug!
] macro to print the output of a system. - errorDeprecatedSystem adapter that utilizes the [
bevy_utils::tracing::error!
] macro to print the output of a system. - ignoreDeprecatedSystem adapter that ignores the output of the previous system in a pipe. This is useful for fallible systems that should simply return early in case of an
Err
/None
. - Generates a
Condition
-satisfying closure that returnstrue
if the state machine is currently instate
. - infoDeprecatedSystem adapter that utilizes the [
bevy_utils::tracing::info!
] macro to print system information. - Generates a
Condition
that inverses the result of passed one. - Generates a
Condition
-satisfying closure that returnstrue
if there are any new events of the given type since it was last called. - Generates a
Condition
-satisfying closure that returnstrue
if the resource of the given type has been added since the condition was last checked. - Generates a
Condition
-satisfying closure that returnstrue
if the resource of the given type has had its value changed since the condition was last checked. - Generates a
Condition
-satisfying closure that returnstrue
if the resource of the given type has had its value changed since the condition was last checked. - Generates a
Condition
-satisfying closure that returnstrue
if the resource exists. - Generates a
Condition
-satisfying closure that returnstrue
if the resource of the given type has had its value changed since the condition was last checked. - Generates a
Condition
-satisfying closure that returnstrue
if the resource exists and is equal tovalue
. - Generates a
Condition
-satisfying closure that returnstrue
if the resource of the given type has been removed since the condition was last checked. - Generates a
Condition
-satisfying closure that returnstrue
if the first time the condition is run and false every time after - Generates a
Condition
-satisfying closure that returnstrue
if the state machine changed state. - Generates a
Condition
-satisfying closure that returnstrue
if the state machine exists. - Generates a
Condition
-satisfying closure that returnstrue
if the state machine exists and is currently instate
. - unwrapDeprecatedSystem adapter that unwraps the
Ok
variant of aResult
. This is useful for fallible systems that should panic in the case of an error. - warnDeprecatedSystem adapter that utilizes the [
bevy_utils::tracing::warn!
] macro to print the output of a system.
Derive Macros
- Generates a dynamic plugin entry point function for the given
Plugin
type. - Derive macro generating an impl of the trait
SystemSet
.