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::empty();
app.add_systems(Update, || println!("yippee!"));
app.update()
// ...
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;
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 the first time after they have been added.
- 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. App
is the primary API for writing user applications. It automates the setup of a standard lifecycle and provides interface glue for plugins.- A
Resource
storing [TypeRegistry
] 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 the first time after they have been added or mutably dereferenced.
- 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
QueryData
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. - Contains the visible equipment of a
LivingEntity
, such as armor and held items. By default this is not synced with a player’svalence_inventory::Inventory
, so the armor the player has equipped in their inventory, will not be visible by other players. You would have to change the equipment in this component here or attach theEquipmentInventorySync
component to the player entity to sync the equipment with the inventory. - 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.
- Runs first in the
FixedMain
schedule. - The schedule that runs last in
FixedMain
- The schedule that runs after the
FixedUpdate
schedule, for reacting to changes made in the main update logic. - The schedule that contains logic that must run before
FixedUpdate
. - The schedule that contains most gameplay logic.
- 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.
- 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 or of a resource.
- 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.
- 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. - Trigger emitted when a component is added to an entity.
- Trigger emitted when a component is inserted on to to an entity.
- Trigger emitted when a component is removed from an entity.
- 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 runs once after
Startup
. - 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 runs before
Startup
. - 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.
- Builder struct to create
QueryState
instances at runtime. - 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
trait of a type. - A struct used to operate on the reflected
FromWorld
trait of a type. - A struct used to operate on reflected
Resource
of a type. - A
SystemParam
that yields entities that had theirT
Component
removed or have been despawned with it. - 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.
- Contains global server state accessible as a
Resource
. - The schedule that contains scene spawning.
- The schedule that runs once when the app starts.
- A secondary application with its own
World
. These can run independently of each other. - Builder struct used to construct state for
SystemParam
passed to a system. - 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. Ideally containing anything that must run once per render frame, such as UI.
- 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.
- Controls whether or not the events in an
EventRegistry
should be updated.
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.
- Something that “happens” and might be read / observed by app logic.
- 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. - 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. - A
Condition
-satisfying system 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. - 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. - A
Condition
-satisfying system that returnstrue
if the resource of the given type has been added since the condition was last checked. - A
Condition
-satisfying system 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. - A
Condition
-satisfying system that returnstrue
if the resource exists. - A
Condition
-satisfying system 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
Derive Macros§
- Generates a dynamic plugin entry point function for the given
Plugin
type. - Derive macro generating an impl of the trait
SystemSet
.