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§
- 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.
Structs§
- 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:
AdvancementDisplay[Parent] - 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 Event - This event sends when the client changes or closes advancement’s tab.
- 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. - 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.
- 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 [
WorldQuery] type for a read-only variant ofClientSpawnQuery. - Commands
- A
Commandqueue to perform structural changes to theWorld. - Compound
- A map type with
Stringkeys andValuevalues. - 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 theWorldduringapply_deferred. This is used internally byCommandsto deferWorldmutations. - Despawned
- A marker
Componentfor entities that should be despawned at the end of the tick. - Digging
Event - Dimension
Type - Dimension
Type Registry - Entity
- Lightweight identifier of 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. This is essentially a performance-optimized(Entity, &mut World)tuple, which caches theEntityLocationto reduce duplicate lookups. - 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 - Event
Reader - Reads events of type
Tin order and tracks which events have already been read. - Event
Writer - Sends events of type
T. - Events
- An event collection that represents the events that occurred within the last two
Events::updatecalls. Events can be written to using anEventWriterand are typically cheaply read using anEventReader. - 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.
- 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. - In
- Wrapper type to mark a
SystemParamas an input. - Interact
Entity Event - 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 Event - Last
- Runs last in the schedule.
- Layer
Bundle - Convenience
Bundlefor spawning a layer entity with bothChunkLayerandEntityLayercomponents. - Leave
BedEvent - Loaded
Chunk - Local
- A system local
SystemParam. - 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(). - Mut
- Unique mutable borrow of an entity’s component or of a resource.
- 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. - OnAdd
- Trigger emitted when a component is added to an entity.
- OnInsert
- Trigger emitted when a component is inserted on to to an entity.
- OnRemove
- Trigger emitted when a component is removed from an entity.
- 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. - Player
List - Player
List Entry - Marker component for player list entries.
- 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 anEventsresource. This enables systems inUpdateto consume the events from theEventsresource 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
- 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
From World - A struct used to operate on the reflected
FromWorldtrait of a type. - Reflect
Resource - A struct used to operate on reflected
Resourceof a type. - Registry
Id - 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.
- 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 - Sneak
Event - Spawn
Scene - The schedule that contains scene spawning.
- Sprint
Event - 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. - System
Builder - Builder struct used to construct state for
SystemParampassed to a system. - Text
- Represents formatted text in Minecraft’s JSON text format.
- Trigger
- Type containing triggered
Eventinformation for a given run of anObserver. This contains theEventdata itself. If it was triggered for a specificEntity, it includes that as well. - Unique
Id - The universally unique identifier of an entity. Component wrapper for a
Uuid. - Unloaded
Chunk - Update
- The schedule that contains app logic. Ideally containing anything that must run once per render frame, such as UI.
- 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. - 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
- An event that indicates the
Appshould 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.
- Should
Update Events - Controls whether or not the events in an
EventRegistryshould be updated. - 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. - Component
- A data type that can be used to store data for an entity.
- Condition
- A system that determines if one or more scheduled systems should run.
- 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
Mapper - An implementor of this trait knows how to map an
Entityinto anotherEntity. - Event
- Something that “happens” and might be read / observed by app logic.
- From
World - Creates an instance of the type this trait is implemented for
using data from the supplied
World. - Into
System - Conversion trait to turn something into a
System. - Into
System Configs - Types that can convert into a
SystemConfigs. - Into
System Set - Types that can be converted into a
SystemSet. - Into
System SetConfigs - Types that can convert into a
SystemSetConfigs. - Into
Text - Trait for any data that can be converted to a
Textobject. - Network
Callbacks - This trait uses
async_trait. - 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.- Resource
- A type that can be inserted into a
Worldas a singleton. - System
- An ECS system that can be added to a
Schedule - System
Param Function - A trait implemented for all functions that can be used as
Systems. - System
Set - Types that identify logical groups of systems.
Functions§
- any_
component_ removed - Generates a
Condition-satisfying closure that returnstrueif there are any entity with a component of the given type removed. - any_
with_ component - A
Condition-satisfying system that returnstrueif there are any entities with the given component type. - apply_
deferred - Instructs the executor to call
System::apply_deferredon the systems that have run but not applied theirDeferredsystem parameters (likeCommands) or other system buffers. - despawn_
disconnected_ clients - A system for adding
Despawnedcomponents to disconnected clients. This works by listening for removedClientcomponents. - not
- Generates a
Conditionthat inverses the result of passed one. - on_
event - Generates a
Condition-satisfying closure that returnstrueif there are any new events of the given type since it was last called. - resource_
added - A
Condition-satisfying system that returnstrueif the resource of the given type has been added since the condition was last checked. - resource_
changed - A
Condition-satisfying system that returnstrueif the resource of the given type has had its value changed since the condition was last checked. - resource_
changed_ or_ removed - Generates a
Condition-satisfying closure that returnstrueif the resource of the given type has had its value changed since the condition was last checked. - resource_
equals - Generates a
Condition-satisfying closure that returnstrueif the resource is equal tovalue. - resource_
exists - A
Condition-satisfying system that returnstrueif the resource exists. - resource_
exists_ and_ changed - A
Condition-satisfying system that returnstrueif the resource of the given type has had its value changed since the condition was last checked. - resource_
exists_ and_ equals - Generates a
Condition-satisfying closure that returnstrueif the resource exists and is equal tovalue. - resource_
removed - Generates a
Condition-satisfying closure that returnstrueif the resource of the given type has been removed since the condition was last checked. - run_
once - Generates a
Condition-satisfying closure that returnstrueif the first time the condition is run and false every time after