Expand description
Contains the most frequently used items in ChunkEdge projects.
This is usually glob imported like so:
use chunkedge::prelude::*; // Glob import.
let mut app = App::empty();
app.add_systems(Update, || println!("yippee!"));
app.update()
// ...Re-exports§
pub use chunkedge_server::message::SendMessage as _;pub use chunkedge_server::title::SetTitle as _;pub use super::DefaultPlugins;pub use bevy_ecs;pub use chunkedge_server::ident;
Macros§
- children
- Returns a
SpawnRelatedBundlethat will insert theChildrencomponent, spawn aSpawnableListof entities with given bundles that relate to theChildrenentity via theChildOfcomponent, and reserve space in theChildrenfor each spawned entity. - ident
- Creates a new
Identat compile time from a string literal. A compile error is raised if the string is not a valid resource identifier. - related
- Returns a
SpawnRelatedBundlethat will insert the givenRelationshipTarget, spawn aSpawnableListof entities with given bundles that relate to theRelationshipTargetentity via theRelationshipTarget::Relationshipcomponent, and reserve space in theRelationshipTargetfor each spawned entity.
Structs§
- Add
- Trigger emitted when a component is inserted onto an entity that does not already have that
component. Runs before
Insert. SeeComponentHooks::on_addfor more information. - Added
- A filter on a component that only retains results the first time after they have been added.
- Advancement
- Advancement’s id. May not be updated.
- Advancement
Bundle - Components for advancement that are required
Optional components:
AdvancementDisplayChildOf- parent advancement - Advancement
Client Update - Advancement
Criteria - Criteria’s identifier. May not be updated
- Advancement
Display - Advancement display. Optional component
- Advancement
Requirements - Requirements for advancement to be completed. All columns should be completed, column is completed when any of criteria in this column is completed.
- Advancement
TabChange Message - This message sends when the client changes or closes advancement’s tab.
- Allow
- Allows a query to contain entities with the component
T, bypassingDefaultQueryFilters. - AnyOf
- The
AnyOfquery parameter fetches entities with any of the component types included in T. - App
Appis the primary API for writing user applications. It automates the setup of a standard lifecycle and provides interface glue for plugins.- AppType
Registry - A
Resourcestoring [TypeRegistry] for type registrations relevant to a whole app. - Apply
Deferred - A special
Systemthat instructs the executor to callSystem::apply_deferredon the systems that have run but not applied theirDeferredsystem parameters (likeCommands) or other system buffers. - Bevy
Error - The built in “universal” Bevy error type. This has a blanket
Fromimpl for any type that implements Rust’sError, meaning it can be used as a “catch all” error. - Biome
- BiomeId
- Biome
Registry - Block
- Represents a complete block, which is a pair of block state and optional NBT data for the block entity.
- Block
Pos - Represents an absolute block position in world space.
- Block
Ref - Like
Block, but immutably referenced. - Block
State - 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.
- Changed
- A filter on a component that only retains results the first time after they have been added or mutably dereferenced.
- ChildOf
- Stores the parent entity of this child entity with this component.
- Children
- Tracks which entities are children of this parent entity.
- Chunk
Layer - A
Componentcontaining the chunks and dimension information of a Minecraft world. - Chunk
Pos - The X and Z position of a chunk.
- Chunk
View - Represents the set of all chunk positions that a client can see, defined by
a center chunk position
posand view distancedist. - Client
- The main client component. Contains the underlying network connection and packet buffer.
- Client
Spawn Query - A convenient
QueryDatafor obtaining client spawn components. Also seeClientSpawnQueryReadOnly. - Client
Spawn Query Read Only - Automatically generated
WorldQuerytype for a read-only variant ofClientSpawnQuery. - Commands
- A
Commandqueue to perform structural changes to theWorld. - Compound
- A map type with
Stringkeys andValuevalues. - Contiguous
Mut - Data type returned by
ContiguousQueryData::fetch_contiguousforMut<T>and&mut T - Contiguous
Ref - Contiguous equivalent of
Ref<T>. - Cursor
Item - The item stack that the client thinks it’s holding under the mouse cursor.
- DVec2
- A 2-dimensional vector.
- DVec3
- A 3-dimensional vector.
- Deferred
- A
SystemParamthat stores a buffer which gets applied to theWorldduringApplyDeferred. This is used internally byCommandsto deferWorldmutations. - Despawn
EntityEventemitted for each component on an entity when it is despawned. SeeComponentHooks::on_despawnfor more information.- Despawned
- A marker
Componentfor entities that should be despawned at the end of the tick. - Digging
Message - Dimension
Type - Dimension
Type Registry - Discard
- Trigger emitted when a component is removed from an entity, regardless of whether or not it is later replaced.
- Entity
- Unique identifier for an entity in a
World. Note that this is just an id, not the entity itself. Further, the entity this id refers to may no longer exist in theWorld. For more information about entities, their ids, and how to use them, see the module docs. - Entity
Commands - A list of commands that will be run to modify an
Entity. - Entity
Kind - Identifies the type of an entity. As a component, the entity kind should not be modified.
- Entity
Layer - A
Componentcontaining Minecraft entities. - Entity
Layer Id - Contains the entity layer an entity is on.
- Entity
Manager - A
Resourcewhich maintains information about all spawned Minecraft entities. - Entity
Mut - Provides mutable access to a single entity and all of its components.
- Entity
Ref - A read-only reference to a particular
Entityand all of its components. - Entity
World Mut - A mutable reference to a particular
Entity, and the entire world. - Equipment
- Contains the visible equipment of a
LivingEntity, such as armor and held items. By default this is not synced with a player’schunkedge_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 theEquipmentInventorySynccomponent to the player entity to sync the equipment with the inventory. - Erased
Network Callbacks - A type-erased wrapper around an
NetworkCallbacksobject. - Event
Loop Post Update - Event
Loop PreUpdate - Event
Loop Update - Filtered
Resources - Provides read-only access to a set of
Resources defined by the containedAccess. - Filtered
Resources Mut - Provides mutable access to a set of
Resources defined by the containedAccess. - First
- Runs first in the schedule.
- Fixed
First - Runs first in the
FixedMainschedule. - Fixed
Last - The schedule that runs last in
FixedMain - Fixed
Post Update - The schedule that runs after the
FixedUpdateschedule, for reacting to changes made in the main update logic. - Fixed
PreUpdate - The schedule that contains logic that must run before
FixedUpdate. - Fixed
Update - The schedule that contains most gameplay logic, which runs at a fixed rate rather than every render frame.
For logic that should run once per render frame, use the
Updateschedule instead. - Has
- Returns a bool that describes if an entity has the component
T. - HeadYaw
- Hitbox
- Hitbox, aabb of which is calculated each tick using its position and
Hitbox. In order to change size of this hitbox you need to changeHitbox. - Hitbox
Shape - 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.
- Ident
- A wrapper around a string type
Swhich guarantees the wrapped string is a valid resource identifier. - If
- A
SystemParamthat wraps another parameter and causes its system to skip instead of failing when the parameter is invalid. - In
- A
SystemInputtype which denotes that aSystemreceives an input value of typeTfrom its caller. - InMut
- A
SystemInputtype which denotes that aSystemreceives a mutable reference to a value of typeTfrom its caller. - InRef
- A
SystemInputtype which denotes that aSystemreceives a read-only reference to a value of typeTfrom its caller. - Insert
- Trigger emitted when a component is inserted, regardless of whether or not the entity already
had that component. Runs after
Add, if it ran. SeeComponentHooks::on_insertfor more information. - Interact
Entity Message - Inventory
- Inventory
Window - A helper to represent the inventory window that the player is currently viewing. Handles dispatching reads to the correct inventory.
- Inventory
Window Mut - A helper to represent the inventory window that the player is currently viewing. Handles dispatching reads/writes to the correct inventory.
- Ip
- Item
Stack - A stack of items in an inventory.
- Jump
With Horse Message - Last
- Runs last in the schedule.
- Layer
Bundle - Convenience
Bundlefor spawning a layer entity with bothChunkLayerandEntityLayercomponents. - Leave
BedMessage - Loaded
Chunk - Local
- A
SystemParamthat provides a system-private value ofTthat persists across system calls. - Look
- Describes the direction an entity is looking using pitch and yaw angles.
- Main
- The schedule that contains the app logic that is evaluated each tick of
App::update(). - Message
Mutator - Reads and writes
Messages of typeT, keeping track of which messages have already been read. - Message
Reader - Reads
Messages of typeTin order and tracks which messages have already been read. - Message
Writer - Writes
Messages of typeT. - Messages
- A message collection that represents the messages that occurred within the last two
Messages::updatecalls. Messages can be written to using aMessageWriterand are typically cheaply read using aMessageReader. - Mut
- Unique mutable borrow of an entity’s component or of a resource.
- Name
- Component used to identify an entity. Stores a hash for faster comparisons.
- Name
OrEntity - Convenient query for giving a human friendly name to an entity.
- Network
Settings - Settings for
NetworkPlugin. Note that mutations to these fields have no effect after the plugin is built. - NewClient
Info - Contains information about a new client joining the server.
- NonSend
- Shared borrow of a non-
Sendresource. - NonSend
Mut - Unique borrow of a non-
Sendresource. - Observer
- An
Observersystem. Add thisComponentto anEntityto turn it into an “observer”. - OldEntity
Layer Id - The value of
EntityLayerIdfrom the end of the previous tick. - OldPosition
- The value of
Positionfrom the end of the previous tick. - OldView
- OldView
Distance - The
ViewDistanceat the end of the previous tick. Automatically updated asViewDistanceis changed. - On
- A system parameter used by an observer to process events. See
ObserverandEventfor examples. - Open
Inventory - Used to indicate that the client with this component is currently viewing an inventory.
- Or
- A filter that tests if any of the given filters apply.
- Parallel
Commands - An alternative to
Commandsthat can be used in parallel contexts, such as those inQuery::par_iter. - Param
Set - A collection of potentially conflicting
SystemParams allowed by disjoint access. - Passengers
- Automatically maintained on a vehicle entity; lists the entities currently riding it.
- Player
List - Player
List Entry - Marker component for player list entries.
- Populated
- System parameter that works very much like
Queryexcept it always contains at least one matching entity. - Populated
Message Reader - Reads
Messages of typeTin order and tracks which messages have already been read. Skips the system if there no messages. - Position
- Post
Startup - The schedule that runs once after
Startup. - Post
Update - The schedule that contains logic that must run after
Update. For example, synchronizing “local transforms” in a hierarchy to “global” absolute transforms. This enables thePostUpdatetransform-sync system to react to “local transform” changes inUpdatewithout theUpdatesystems needing to know about (or add scheduler dependencies for) the “global transform sync system”. - PreStartup
- The schedule that runs before
Startup. - PreUpdate
- The schedule that contains logic that must run before
Update. For example, a system that reads raw keyboard input OS events into aMessagesresource. This enables systems inUpdateto consume the messages from theMessagesresource without actually knowing about (or taking a direct scheduler dependency on) the “os-level keyboard event system”. - Properties
- Player properties from the game profile.
- Query
- A system parameter that provides selective access to the
Componentdata stored in aWorld. - Query
Builder - Builder struct to create
QueryStateinstances at runtime. - Query
State - Provides scoped access to a
Worldstate according to a givenQueryDataandQueryFilter. - Ref
- Shared borrow of an entity’s component with access to change detection.
Similar to
Mutbut is immutable and so doesn’t require unique access. - Reflect
Component - A struct used to operate on reflected
Componenttrait of a type. - Reflect
Event - A struct used to operate on reflected
Eventtrait of a type. - Reflect
From World - A struct used to operate on the reflected
FromWorldtrait of a type. - Reflect
Message - A struct used to operate on reflected
Messagetrait of a type. - Reflect
Resource - A struct that marks a reflected
Resourceof a type. - Registry
Id - Remove
- Trigger emitted when a component is removed from an entity, and runs before the component is
removed, so you can still access the component data.
See
ComponentHooks::on_removefor more information. - Removed
Components - A
SystemParamthat yields entities that had theirTComponentremoved or have been despawned with it. - Res
- Shared borrow of a
Resource. - ResMut
- Unique mutable borrow of a
Resource. - Respawn
Position - The position and angle that clients will respawn with. Also controls the position that compasses point towards.
- Riding
- Placed on a passenger entity, pointing at the vehicle it rides.
- RunFixed
Main Loop - Runs the
FixedMainschedule in a loop according until all relevant elapsed time has been “consumed”. - Schedule
- A collection of systems, and the metadata and executor needed to run them in a certain order under certain conditions.
- Schedules
- Resource that stores
Schedules mapped toScheduleLabels excluding the current runningSchedule. - Server
- Contains global server state accessible as a
Resource. - Shared
Network State - Single
- System parameter that provides access to single entity’s components, much like
Query::single/Query::single_mut. - Sneak
Message - Spawn
- A wrapper over a
Bundleindicating that an entity should be spawned with thatBundle. This is intended to be used for hierarchical spawning via traits likeSpawnableListandSpawnRelated. - Spawn
Iter - A
SpawnableListthat spawns entities using an iterator of a givenBundle: - Spawn
Scene - The schedule that contains scene spawning.
- Spawn
With - A
SpawnableListthat spawns entities using aFnOncewith aRelatedSpawneras an argument: - Sprint
Message - Startup
- The schedule that runs once when the app starts.
- SubApp
- A secondary application with its own
World. These can run independently of each other. - Task
Pool Options - Helper for configuring and creating the default task pools. For end-users who want full control,
set up
TaskPoolPlugin - Task
Pool Plugin - Setup of default task pools: [
AsyncComputeTaskPool], [ComputeTaskPool], [IoTaskPool]. - Text
- Represents formatted text in Minecraft’s JSON text format.
- Unique
Id - The universally unique identifier of an entity. Component wrapper for a
Uuid. - Unloaded
Chunk - Update
- The schedule that contains any app logic that must run once per render frame.
For most gameplay logic, consider using
FixedUpdateinstead. - Username
- Uuid
- A Universally Unique Identifier (UUID).
- Vec2
- A 2-dimensional vector.
- Vec3
- A 3-dimensional vector.
- View
- View
Distance - Visible
Chunk Layer - A
Componentcontaining a handle to theChunkLayera client can see. - Visible
Entity Layers - A
Componentcontaining the set ofEntityLayers a client can see. All Minecraft entities from all layers in this set are potentially visible to the client. - With
- Filter that selects entities with a component
T. - With
OneRelated - A wrapper over an
Entityindicating that an entity should be added. This is intended to be used for hierarchical spawning via traits likeSpawnableListandSpawnRelated. - With
Related - A
SpawnableListthat links already spawned entities to the root entity via relations of typeI. - Without
- Filter that selects entities without a component
T. - World
- Stores and exposes operations on entities, components, resources, and their associated metadata.
Enums§
- Advancement
Frame Type - AppExit
- A
Messagethat indicates theAppshould exit. If one or more of these are present at the end of an update, the runner will end and (maybe) return control to the caller. - Block
Kind - An enumeration of all block kinds.
- Color
- Text color
- Connection
Mode - Describes how new connections to the server are handled.
- Digging
State - Direction
- Entity
Animation - Entity
Interaction - Entity
Status - Game
Mode - Hand
- Inventory
Kind - Item
Kind - Represents an item from the game
- Jump
With Horse State - Particle
- Player
Command - Prop
Name - Contains all possible block state property names.
- Prop
Value - Contains all possible values that a block property might have.
- RunFixed
Main Loop Systems - Set enum for the systems that want to run inside
RunFixedMainLoop, but before or after the fixed update logic. Systems in this set will run exactly once per frame, regardless of the number of fixed updates. They will also run under a variable timestep. - Severity
- Indicates how severe a
BevyErroris. - Sneak
State - Sprint
State
Traits§
- Bundle
- The
Bundletrait enables insertion and removal ofComponents from an entity. - Chunk
- Common operations on chunks. Notable implementors are
LoadedChunkandUnloadedChunk. - Command
- A
Worldmutation. - Component
- A data type that can be used to store data for an entity.
- Contains
Entity - A trait for types that contain an
Entity. - Detect
Changes - Types that can read change detection information.
This change detection is controlled by
DetectChangesMuttypes such asResMut. - Detect
Changes Mut - Types that implement reliable change detection.
- Entity
Command - A command which gets executed for a given
Entity. - Entity
Event - An
EntityEventis anEventthat is triggered for a specificEntityEvent::event_targetentity: - Entity
Mapper - An implementor of this trait knows how to map an
Entityinto anotherEntity. - Event
- An
Eventis something that “happens” at a given moment. - From
Template FromTemplateis implemented for types that can be produced by a specific, canonicalTemplate. This creates a way to correlate to theTemplateusing the desired template output type. This is used by Bevy’s scene system.- From
World - Creates an instance of the type this trait is implemented for
using data from the supplied
World. - Into
Schedule Configs - Types that can convert into a
ScheduleConfigs. - Into
System - Conversion trait to turn something into a
System. - Into
System Set - Types that can be converted into a
SystemSet. - Into
Text - Trait for any data that can be converted to a
Textobject. - Message
- A buffered message for pull-based event handling.
- Network
Callbacks - This trait uses
async_trait. - Observer
System Ext - Extension trait for adding run conditions to observer systems.
- Plugin
- A collection of Bevy app logic and configuration.
- Plugin
Group - Combines multiple
Plugins into a single unit. - Read
Only System Systemtypes that do not modify theWorldwhen run. This is implemented for any systems whose parameters all implementReadOnlySystemParam.- Relationship
Target - A
Componentcontaining the collection of entities that relate to thisEntityvia the associatedRelationshiptype. See theRelationshipdocumentation for more information. - Resource
- A type that can be inserted into a
Worldas a singleton. - Result
Severity Ext - Extension methods for annotating errors with a
Severity. - Spawn
Related RelationshipTargetmethods that create aBundlewith aDynamicBundle::Effectthat:- System
- An ECS system that can be added to a
Schedule - System
Condition - A system that determines if one or more scheduled systems should run.
- System
Input - Trait for types that can be used as input to
Systems. - System
Param Builder - A builder that can create a
SystemParam. - System
Param Function - A trait implemented for all functions that can be used as
Systems. - System
Set - System sets are tag-like labels that can be used to group systems together.
- Template
- A
Templateis something that, given a spawn context (targetEntity,World, etc), can produce aTemplate::Output.
Functions§
- any_
component_ removed - A
SystemCondition-satisfying system that returnstrueif there are any entity with a component of the given type removed. - any_
match_ filter - A
SystemCondition-satisfying system that returnstrueif there are any entities that match the givenQueryFilter. - any_
with_ component - A
SystemCondition-satisfying system that returnstrueif there are any entities with the given component type. - condition_
changed - Generates a
SystemConditionthat returns true when the passed one changes. - condition_
changed_ to - Generates a
SystemConditionthat returns true when the result of the passed one went from false to true since the last time this was called. - despawn_
disconnected_ clients - A system for adding
Despawnedcomponents to disconnected clients. This works by listening for removedClientcomponents. - not
- Generates a
SystemConditionthat inverses the result of passed one. - on_
message - A
SystemCondition-satisfying system that returnstrueif there are any new messages of the given type since it was last called. - resource_
added - A
SystemCondition-satisfying system that returnstrueif the resource of the given type has been added since the condition was last checked. - resource_
changed - A
SystemCondition-satisfying system that returnstrueif the resource of the given type has been added or mutably dereferenced since the condition was last checked. - resource_
changed_ or_ removed - A
SystemCondition-satisfying system that returnstrueif the resource of the given type has been added, removed or mutably dereferenced since the condition was last checked. - resource_
equals - Generates a
SystemCondition-satisfying closure that returnstrueif the resource is equal tovalue. - resource_
exists - A
SystemCondition-satisfying system that returnstrueif the resource exists. - resource_
exists_ and_ changed - A
SystemCondition-satisfying system that returnstrueif the resource of the given type has been added or mutably dereferenced since the condition was last checked. - resource_
exists_ and_ equals - Generates a
SystemCondition-satisfying closure that returnstrueif the resource exists and is equal tovalue. - resource_
removed - A
SystemCondition-satisfying system that returnstrueif the resource of the given type has been removed since the condition was last checked. - run_
once - A
SystemCondition-satisfying system that returnstrueon the first time the condition is run and false every time after. - template
- Returns a “free floating” template for a given
func. This prevents the need to define a custom type for one-off templates.
Type Aliases§
- Child
Spawner - A type alias over
RelatedSpawnerused to spawn child entities containing aChildOfrelationship. - Child
Spawner Commands - A type alias over
RelatedSpawnerCommandsused to spawn child entities containing aChildOfrelationship. - Result
- A result type for use in fallible systems, commands and observers.
- System
In - Shorthand way to get the
System::Infor aSystemas aSystemInput::Inner.
Derive Macros§
- Bundle
- Implement the
Bundletrait. - Component
- Cheat sheet for derive syntax,
see full explanation and examples on the
Componenttrait doc. - Entity
Event - Cheat sheet for derive syntax,
see full explanation on
EntityEventtrait docs. - Event
- Implement the
Eventtrait. - From
Template - Derives
FromTemplate. - From
World - Implement the
FromWorldtrait. - Message
- Implement the
Messagetrait. - Resource
- Implement the
Resourcetrait. - System
Set - Derive macro generating an impl of the trait
SystemSet.