Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dyc3 committed Aug 4, 2023
1 parent 1bd4a82 commit ea88629
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion crates/valence_scoreboard/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,19 @@ This crate provides functionality for creating and managing scoreboards. In Mine

In Valence, scoreboards obey the rules implied by [`EntityLayer`]s, meaning that every Objective must have an [`EntityLayerId`] associated with it. Scoreboards are only transmitted to clients if the [`EntityLayer`] is visible to the client.

To create a scoreboard, spawn an [`ObjectiveBundle`]. The [`Objective`] component represents the identifier that the client uses to reference the scoreboard.
To create a scoreboard, spawn an [`ObjectiveBundle`]. The [`Objective`] component represents the identifier that the client uses to reference the scoreboard.

Example:

```rust
# use bevy_ecs::prelude::*;
use valence_scoreboard::*;

fn spawn_scoreboard(mut commands: Commands) {
commands.spawn(ObjectiveBundle {
name: Objective::new("foo"),
display: ObjectiveDisplay("Foo".bold())
..Default::default()
});
}
```

0 comments on commit ea88629

Please sign in to comment.