Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating Scarpet docs for Auxiliary.md #1415

Closed
wants to merge 31 commits into from
Closed
Changes from 4 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
32750ff
Adding ability to send messages to action bar
Ghoulboy78 Nov 12, 2020
6e4f7c7
Revert "Adding ability to send messages to action bar"
Ghoulboy78 Nov 12, 2020
3093129
Merge branch 'gnembon:master' into master
Ghoulboy78 Jun 25, 2021
b50ff3e
Merge branch 'master' of https://github.com/Ghoulboy78/fabric-carpet
Ghoulboy78 Oct 31, 2021
a542ea0
Merge remote-tracking branch 'upstream/master'
Ghoulboy78 Mar 4, 2022
90191db
Adding docs to sound() function
Ghoulboy78 Apr 19, 2022
263606d
Updating Sounds title description
Ghoulboy78 Apr 19, 2022
085e643
Updating Particles title description
Ghoulboy78 Apr 19, 2022
a2260dc
Adding docs to particle() function
Ghoulboy78 Apr 19, 2022
cb331b2
Update Auxiliary.md
Ghoulboy78 Apr 20, 2022
7e18ba8
Fixing typos
Ghoulboy78 Jun 7, 2022
f832904
Fixing example
Ghoulboy78 Jun 7, 2022
d72a4cf
Added example for markers
Ghoulboy78 Jun 7, 2022
6bdde70
Adding example to in_dimension()
Ghoulboy78 Jun 20, 2022
7f05ee2
Updated create_marker() docs
Ghoulboy78 Aug 4, 2022
5d69bb9
nbt() docs
Ghoulboy78 Aug 4, 2022
d21ce22
escape_nbt() docs
Ghoulboy78 Aug 4, 2022
7630ecc
parse_nbt() docs
Ghoulboy78 Aug 4, 2022
accc582
encode_nbt() docs
Ghoulboy78 Aug 4, 2022
26351a7
Merge branch 'master' into update-docs
Ghoulboy78 Aug 5, 2022
90a4c47
Squashed commit of the following:
Ghoulboy78 Aug 5, 2022
a9bb758
Updating docs for encode_nbt
Ghoulboy78 Aug 5, 2022
14f9a33
Added example for load_app_data()
Ghoulboy78 Aug 5, 2022
44d8a09
Updating docs for load_app_data()
Ghoulboy78 Aug 5, 2022
bec0a6c
Updating docs for store_app_data()
Ghoulboy78 Aug 5, 2022
c681218
Added notice about broken dimension stuff
Ghoulboy78 Aug 5, 2022
a7b742d
Added examples for tick_time()
Ghoulboy78 Aug 5, 2022
a9531ca
Updated docs for get_mob_counts()
Ghoulboy78 Aug 5, 2022
9e3aea2
Added example for day_time()
Ghoulboy78 Aug 5, 2022
64ecddd
Added example for curent_dimension()
Ghoulboy78 Aug 5, 2022
77be0c3
Added example for schedule()
Ghoulboy78 Aug 5, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 21 additions & 6 deletions docs/scarpet/api/Auxiliary.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,48 @@ Collection of other methods that control smaller, yet still important aspects of

## Sounds

Functions which allow to manipulate the player's auditory environment.

### `sound()`, `sound(name, pos, volume?, pitch?, mixer?)`

Plays a specific sound `name`, at block or position `pos`, with optional `volume` and modified `pitch`, and under
optional `mixer`. Default values for `volume`, `pitch` and `mixer` are `1.0`, `1.0`, and `master`.
Valid mixer options are `master`, `music`, `record`, `weather`, `block`, `hostile`,`neutral`, `player`, `ambient`
and `voice`. `pos` can be either a block, triple of coords, or a list of thee numbers. Uses the same options as a
corresponding `playsound` command.
corresponding `playsound` command. Note that modifying `pitch` also modifies the duration of the sound.

Used with no arguments, return the list of available sound names.
Used with no arguments, return the list of all available sound names.

Throws `unknown_sound` if sound doesn't exist.
<pre>
//Plays the sound of a zombie breaking down a door, with 4x the volume and 1/4th the pitch
//Turning down ambient music in sound settings will reduce the volume of this sound
sound('entity.zombie.break_wooden_door', [x, y, z], 4, 0.25, 'ambient')
</pre>

## Particles

Functions which allow to send particles of various forms to the player. These allow to highlight zones for all players,
including those with vanilla clients (unlike with `draw_shape` function which only works for players with carpet clients)
Ghoulboy78 marked this conversation as resolved.
Show resolved Hide resolved

### `particle()`, `particle(name, pos, count?. spread?, speed?, player?)`

Renders a cloud of particles `name` centered around `pos` position, by default `count` 10 of them, default `speed`
of 0, and to all players nearby, but these options can be changed via optional arguments. Follow vanilla `/particle`
command on details on those options. Valid particle names are
for example `'angry_villager', 'item diamond', 'block stone', 'dust 0.8 0.1 0.1 4'`.
Renders a cloud of particles `name` centered around `pos` position, by default `count` 10 of them, default `spread` 0.5 blocks,
default `speed` of 0, and to all players nearby, but these options can be changed via optional arguments. Follow vanilla
`/particle` command on details on those options. Valid particle names are for example `'angry_villager', 'item diamond',
'block stone', 'dust 0.8 0.1 0.1 4'`.

Used with no arguments, return the list of available particle names. Note that some of the names do not correspond to a valid
particle that can be fed to `particle(...)` function due to a fact that some particles need more configuration
to be valid, like `dust`, `block` etc. Should be used as a reference only.

Throws `unknown_particle` if particle doesn't exist.

<pre>
// Shows 40 angry villager particles centred on the player's feet, with a spread of 0.75 blocks and speed of 1
particle('angry_villager', [x, y, z], 40, 0.75, 1)
</pre>

### `particle_line(name, pos, pos2, density?, player?)`

Renders a line of particles from point `pos` to `pos2` with supplied density (defaults to 1), which indicates how far
Expand Down