diff --git a/docs/scarpet/Full.md b/docs/scarpet/Full.md index 65fa25bf..36a7d973 100644 --- a/docs/scarpet/Full.md +++ b/docs/scarpet/Full.md @@ -976,10 +976,11 @@ title('aBc') => 'Abc' ### `replace(string, regex, repl?); replace_first(string, regex, repl?)` Replaces all, or first occurence of a regular expression in the string with `repl` expression, -or nothing, if not specified +or nothing, if not specified. To use escape characters (`\(`,`\+`,...), metacharacters (`\d`,`\w`,...), or position anchors (`\b`,`\z`,...) in your regular expression, use two backslashes.
 replace('abbccddebfg','b+','z')  // => azccddezfg
+replace('abbccddebfg','\\w$','z')  // => abbccddebfz
 replace_first('abbccddebfg','b+','z')  // => azccddebfg
 
@@ -1199,7 +1200,8 @@ not present, and default expression is provided, sets a new value to be associat ### `system_variable_set(key, new_value)` Returns the variable from the system shared key-value storage keyed with a `key` value, and sets a new -mapping for the key# Loops, and higher order functions +mapping for the key +# Loops, and higher order functions Efficient use of these functions can greatly simplify your programs and speed them up, as these functions will internalize most of the operations that need to be applied on multiple values at the same time. Most of them take @@ -2680,10 +2682,11 @@ Note: Have to pass all 6 of the mentioned noise types and only these noise types With an optional feature, it returns value for the specified attribute for that biome. Available and queryable features include: * `'top_material'`: unlocalized block representing the top surface material (1.17.1 and below only) * `'under_material'`: unlocalized block representing what sits below topsoil (1.17.1 and below only) -* `'category'`: the parent biome this biome is derived from. Possible values include: +* `'category'`: the parent biome this biome is derived from. Possible values include (1.18.2 and below only): `'none'`, `'taiga'`, `'extreme_hills'`, `'jungle'`, `'mesa'`, `'plains'`, `'savanna'`, `'icy'`, `'the_end'`, `'beach'`, `'forest'`, `'ocean'`, `'desert'`, `'river'`, `'swamp'`, `'mushroom'` , `'nether'`, `'underground'` (1.18+) and `'mountain'` (1.18+). +* `'tags'`: list of biome tags associated with this biome * `'temperature'`: temperature from 0 to 1 * `'fog_color'`: RGBA color value of fog * `'foliage_color'`: RGBA color value of foliage @@ -2940,9 +2943,9 @@ with minecraft 1.16.1 and below or 1.16.2 and above since in 1.16.2 Mojang has a meaning that since 1.16.2 - they have official names that can be used by datapacks and scarpet. If you have most recent scarpet on 1.16.4, you can use `plop()` to get all available worldgen features including custom features and structures controlled by datapacks. It returns a map of lists in the following categories: -`'scarpet_custom'`, `'configured_features'`, `'structures'`, `'features'`, `'configured_structures'` +`'scarpet_custom'`, `'configured_features'`, `'structures'`, `'features'`, `'structure_types'` -### Previous Structure Names, including variants (MC1.16.1 and below) +### Previous Structure Names, including variants (for MC1.16.1 and below only) * `'monument'`: Ocean Monument. Generates at fixed Y coordinate, surrounds itself with water. * `'fortress'`: Nether Fortress. Altitude varies, but its bounded by the code. * `'mansion'`: Woodland Mansion @@ -3036,28 +3039,10 @@ controlled by datapacks. It returns a map of lists in the following categories: * `'twisting_vines'` (1.16) * `'basalt_pillar'` (1.16) -### Standard Structures (as of MC1.16.2+) -Use `plop():'structures'`, but it always returns the following: +### World Generation Features and Structures (as of MC1.16.2+) -`'bastion_remnant'`, `'buried_treasure'`, `'desert_pyramid'`, `'endcity'`, `'fortress'`, `'igloo'`, -`'jungle_pyramid'`, `'mansion'`, `'mineshaft'`, `'monument'`, `'nether_fossil'`, `'ocean_ruin'`, -`'pillager_outpost'`, `'ruined_portal'`, `'shipwreck'`, `'stronghold'`, `'swamp_hut'`, `'village'` - -### Structure Variants (as of MC1.16.2+) - -Use `plop():'configured_structures'`, but it always returns the following: - -`'bastion_remnant'`, `'buried_treasure'`, `'desert_pyramid'`, `'end_city'`, `'fortress'`, `'igloo'`, -`'jungle_pyramid'`, `'mansion'`, `'mineshaft'`, `'mineshaft_mesa'`, `'monument'`, `'nether_fossil'`, -`'ocean_ruin_cold'`, `'ocean_ruin_warm'`, `'pillager_outpost'`, `'ruined_portal'`, `'ruined_portal_desert'`, -`'ruined_portal_jungle'`, `'ruined_portal_mountain'`, `'ruined_portal_nether'`, `'ruined_portal_ocean'`, -`'ruined_portal_swamp'`, `'shipwreck'`, `'shipwreck_beached'`, `'stronghold'`, `'swamp_hut'`, -`'village_desert'`, `'village_plains'`, `'village_savanna'`, `'village_snovy'`, `'village_taiga'` - -### World Generation Features (as of MC1.16.2+) - -Use `plop():'features'` and `plop():'configured_features'` for a list of available options. Your output may vary based on +Use `plop():'structure_types'`, `plop():'structures'`, `plop():'features'`, and `plop():'configured_features'` for a list of available options. Your output may vary based on datapacks installed in your world. ### Custom Scarpet Features @@ -3140,7 +3125,7 @@ Throws `unknown_structure` if structure doesn't exist. Plops a structure or a feature at a given `pos`, so block, triple position coordinates or a list of coordinates. To `what` gets plopped and exactly where it often depends on the feature or structure itself. -Requires a `Structure Variant`, `Standard Structure`, `World Generation Feature` or `Custom Scarpet Feature` name (see +Requires a `Structure Type`, `Structure`, `World Generation Feature` or `Custom Scarpet Feature` name (see above). If standard name is used, the variant of the structure may depend on the biome, otherwise the default structure for this type will be generated. @@ -3156,30 +3141,6 @@ which sets it without looking into world blocks, and then use `plop` to fill it All generated structures will retain their properties, like mob spawning, however in many cases the world / dimension itself has certain rules to spawn mobs, like plopping a nether fortress in the overworld will not spawn nether mobs, because nether mobs can spawn only in the nether, but plopped in the nether - will behave like a valid nether fortress. - -### (deprecated) `custom_dimension(name, seed?)` - -Deprecated by `create_datapack()` which can be used to setup custom dimensions - -Ensures the dimension with the given `'name'` is available and configured with the given seed. It merely sets the world -generator settings to the overworld, and the optional custom seed (or using current world seed, if not provided). - -If the dimension with this name already exists, returns `false` and does nothing. - -Created dimension with `custom_dimension` only exist till the game restart (same with the datapacks, if removed), but -all the world data should be saved. If custom dimension is re-created next time the app is loaded it will be using -the existing world content. This means that it is up to the programmer to make sure the custom dimensions settings -are stored in app data and restored when app reloads and wants to use previous worlds. Since vanilla game only keeps -track of world data, not the world settings, if the dimension hasn't been yet configured via `custom_dimension` and -the app hasn't yet initalized their dimension, the players will be positioned in the overworld at the same coordinates. - -List of custom dimensions (to be used in the likes of `/execute in `) is only send to the clients when joining the -game, meaning custom worlds created after a player has joined will not be suggested in vanilla commands, but running -vanilla commands on them will be successful. Its due to the fact that datapacks with dimensions are always loaded -with the game and assumed not changing. - -`custom_dimension` is experimental and considered a WIP. More customization options besides the seed will be added in -the future. # Iterating over larger areas of blocks These functions help scan larger areas of blocks without using generic loop functions, like nested `loop`.