Added nbt_storage() scapet function (#655)

* Added storage() scarpet function

Allows you to easly manage vanilla data command storage

* Added docs and uniformed with scoreboard()

storage(key, nbt) will now return the previous value to be consistant with the scoreboard() command.

* Included imports

* Renamed storage function to nbt_storage

* Update docs/scarpet/api/Auxiliary.md

Co-authored-by: gnembon <41132274+gnembon@users.noreply.github.com>
This commit is contained in:
BisUmToandgnembon authored and GitHub committed 2021-01-13 21:14:57 -04:00
1 parent df20f9e4e4
commit 2121a91a55
4 files changed
+35

No files matched your search

+6
View File
@@ -540,3 +540,9 @@ Available options in the scarpet app space:
Scarpet related properties
* `scarpet_version` - returns the version of the carpet your scarpet comes with.
## NBT Storage
### `nbt_storage()`, `nbt_storage(key)`, `nbt_storage(key, nbt)`
Displays or modifies individual storage NBT tags. With no arguments, returns the list of current NBT storages. With specified `key`, returns the `nbt` associated with current `key`, or `null` if storage does not exist. With specified `key` and `nbt`, sets a new `nbt` value, returning previous value associated with the `key`.
NOTE: This NBT storage is shared with all vanilla datapacks and scripts of the entire server and is persistent between restarts and reloads. You can also access this NBT storage with vanilla `/data <get|modify|merge> storage <key> ...` command.
@@ -67,6 +67,7 @@ map_colour
material
modify
nbt
nbt_storage
neighbours
opacity
parse_nbt
@@ -86,6 +86,8 @@
load_app_data store_app_data read_file write_file delete_file list_files
escape_nbt parse_nbt encode_nbt tag_matches statistic
nbt_storage
</Keywords>
<Keywords name="Keywords3">euler pi null true false</Keywords>
<Keywords name="Keywords4">x y z p</Keywords>