From 5e5c434e8145b028da6b547e4c5e85f49700b207 Mon Sep 17 00:00:00 2001 From: Ghoulboy Date: Fri, 7 Jul 2023 14:54:21 +0200 Subject: [PATCH] Updating Scarpet docs for BlockIterations.md (#1757) --- docs/scarpet/api/BlocksAndWorldAccess.md | 26 ++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/docs/scarpet/api/BlocksAndWorldAccess.md b/docs/scarpet/api/BlocksAndWorldAccess.md index 86d11329..70c266a9 100644 --- a/docs/scarpet/api/BlocksAndWorldAccess.md +++ b/docs/scarpet/api/BlocksAndWorldAccess.md @@ -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.
+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.
+
+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
+
+ ### `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 +
+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
+
+ ### `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 -
    block_data(x,y,z) => '{TransferCooldown:0,x:450,y:68, ... }'
+
+block_data(x,y,z) => '{TransferCooldown:0,x:450,y:68, ... }'
 
### `poi(pos), poi(pos, radius?, type?, status?, column_search?)`