Updating Scarpet docs for BlockIterations.md (#1757)

This commit is contained in:
Ghoulboy authored and GitHub committed 2023-07-07 14:54:21 +02:00
1 parent 4c134cc88a
commit 5e5c434e81
1 file changed
+22 -4
+22 -4
View File
@@ -241,9 +241,10 @@ If called with no args, returns `'clear'`, `'rain` or `'thunder'` based on the c
always return `'thunder'`, if not will return `'rain'` or `'clear'` based on the current weather.
With one arg, (either `'clear'`, `'rain` or `'thunder'`), returns the number of remaining ticks for that weather type.
NB: It can thunder without there being a thunderstorm, there has to be both rain and thunder to form a storm.
NB: It can thunder without there being a thunderstorm; there has to be both rain and thunder to form a storm. So if
running `weather()` returns `'thunder'`, you can use `weather('rain')>0` to see if there's a storm going on.
With two args, sets the weather to `type` for `ticks` ticks.
With two args, sets the weather to the given `type` for `ticks` ticks.
## Block and World querying
@@ -292,6 +293,7 @@ back in state definition in various applications where block properties are requ
Throws `unknown_block` if the provided input is not valid.
<pre>
set(x,y,z,'iron_block'); block_state(x,y,z) => {}
set(x,y,z,'iron_trapdoor','half','top'); block_state(x,y,z) => {waterlogged: false, half: top, open: false, ...}
set(x,y,z,'iron_trapdoor','half','top'); block_state(x,y,z,'half') => top
block_state('iron_trapdoor','half') => top
@@ -303,7 +305,14 @@ bool(block_state(block('iron_trapdoor[half=top]'),'powered')) => 0
### `block_list()`, `block_list(tag)`
Returns list of all blocks. If tag is provided, returns list of blocks that belong to this block tag.
Returns list of all blocks in the game. If `tag` is provided, returns list of all blocks that belong to this block tag.
<pre>
block_list() => [dark_oak_button, wall_torch, structure_block, polished_blackstone_brick_slab, cherry_sapling... ]
block_list('impermeable') => [glass, white_stained_glass, orange_stained_glass, magenta_stained_glass... ] //All da glass
block_list('rails') => [rail, powered_rail, detector_rail, activator_rail]
block_list('not_a_valid_block_tag') => null //Not a valid block tag
</pre>
### `block_tags()`, `block_tags(block)`, `block_tags(block, tag)`
@@ -313,12 +322,21 @@ to this tag, and `true` if the block belongs to the tag.
Throws `unknown_block` if `block` doesn't exist
<pre>
block_tags() => [geode_invalid_blocks, wall_post_override, ice, wooden_stairs, bamboo_blocks, stone_bricks... ]
block_tags('iron_block') => [mineable/pickaxe, needs_stone_tool, beacon_base_blocks]
block_tags('glass') => [impermeable]
block_tags('glass', 'impermeable') => true
block_tags('glass', 'beacon_base_blocks') => false
</pre>
### `block_data(pos)`
Return NBT string associated with specific location, or null if the block does not carry block data. Can be currently
used to match specific information from it, or use it to copy to another block
<pre> block_data(x,y,z) => '{TransferCooldown:0,x:450,y:68, ... }'
<pre>
block_data(x,y,z) => '{TransferCooldown:0,x:450,y:68, ... }'
</pre>
### `poi(pos), poi(pos, radius?, type?, status?, column_search?)`