Merge branch 'master' into 1.17
This commit is contained in:
commit
b7cb73d38b
4 files changed
+73
-34
No files matched your search
@@ -432,47 +432,86 @@ Synopsis:
|
|||||||
<pre>
|
<pre>
|
||||||
script run create_datapack('foo',
|
script run create_datapack('foo',
|
||||||
{
|
{
|
||||||
'foo' -> {
|
'foo' -> { 'bar.json' -> {
|
||||||
'bar.json' -> {
|
'c' -> true,
|
||||||
'c' -> true,
|
'd' -> false,
|
||||||
'd' -> false,
|
'e' -> {'foo' -> [1,2,3]},
|
||||||
'e' -> {'foo' -> [1,2,3]},
|
'a' -> 'foobar',
|
||||||
'a' -> 'foobar',
|
'b' -> 5
|
||||||
'b' -> 5
|
} }
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
Custom dimension example:
|
||||||
|
<pre>
|
||||||
script run create_datapack('funky_world', {
|
script run create_datapack('funky_world', {
|
||||||
'data' -> {
|
'data' -> { 'minecraft' -> { 'dimension' -> { 'custom_ow.json' -> {
|
||||||
'minecraft' -> {
|
'type' -> 'minecraft:the_end',
|
||||||
'dimension' -> {
|
'generator' -> {
|
||||||
'custom_ow.json' -> {
|
'biome_source' -> {
|
||||||
'type' -> 'minecraft:the_end',
|
'seed' -> 0,
|
||||||
'generator' -> {
|
'large_biomes' -> false,
|
||||||
'biome_source' -> {
|
'type' -> 'minecraft:vanilla_layered'
|
||||||
'seed' -> 0,
|
},
|
||||||
'large_biomes' -> false,
|
'seed' -> 0,
|
||||||
'type' -> 'minecraft:vanilla_layered'
|
'settings' -> 'minecraft:nether',
|
||||||
},
|
'type' -> 'minecraft:noise'
|
||||||
'seed' -> 0,
|
} } } } }
|
||||||
'settings' -> 'minecraft:nether',
|
|
||||||
'type' -> 'minecraft:noise'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
check_hidden_dimensions(); => ['funky_world']
|
check_hidden_dimensions(); => ['funky_world']
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
Loot table example:
|
||||||
|
<pre>
|
||||||
|
script run create_datapack('silverfishes_drop_gravel', {
|
||||||
|
'data' -> { 'minecraft' -> { 'loot_tables' -> { 'entities' -> { 'silverfish.json' -> {
|
||||||
|
'type' -> 'minecraft:entity',
|
||||||
|
'pools' -> [
|
||||||
|
{
|
||||||
|
'rolls' -> {
|
||||||
|
'min' -> 0,
|
||||||
|
'max' -> 1
|
||||||
|
},
|
||||||
|
'entries' -> [
|
||||||
|
{
|
||||||
|
'type' -> 'minecraft:item',
|
||||||
|
'name' -> 'minecraft:gravel'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
} } } } }
|
||||||
|
});
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
Recipe example:
|
||||||
|
<pre>
|
||||||
|
script run create_datapack('craftable_cobwebs', {
|
||||||
|
'data' -> { 'scarpet' -> { 'recipes' -> { 'cobweb.json' -> {
|
||||||
|
'type' -> 'crafting_shaped',
|
||||||
|
'pattern' -> [
|
||||||
|
'SSS',
|
||||||
|
'SSS',
|
||||||
|
'SSS'
|
||||||
|
],
|
||||||
|
'key' -> {
|
||||||
|
'S' -> {
|
||||||
|
'item' -> 'minecraft:string'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'result' -> {
|
||||||
|
'item' -> 'minecraft:cobweb',
|
||||||
|
'count' -> 1
|
||||||
|
}
|
||||||
|
} } } }
|
||||||
|
});
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
### `enable_hidden_dimensions()`
|
### `enable_hidden_dimensions()`
|
||||||
|
|
||||||
The function reads current datapack settings detecting new dimensions defined by these datapacks that have not yet been added
|
The function reads current datapack settings detecting new dimensions defined by these datapacks that have not yet been added
|
||||||
to the list of current dimensions and adds them so that they can be used and accessed right away. It doesn't matter how the
|
to the list of current dimensions and adds them so that they can be used and accessed right away. It doesn't matter how the
|
||||||
datapacks have been added to the game, either with 'create_datapack()' or manually by dropping a datapack file and calling
|
datapacks have been added to the game, either with `create_datapack()` or manually by dropping a datapack file and calling
|
||||||
`/datapack enable` on it. Returns the list of valid dimension names / identifiers that has been added in the process.
|
`/datapack enable` on it. Returns the list of valid dimension names / identifiers that has been added in the process.
|
||||||
|
|
||||||
Fine print: The function should be
|
Fine print: The function should be
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ set(0,5,0,'bedrock') => bedrock
|
|||||||
set(l(0,5,0), 'bedrock') => bedrock
|
set(l(0,5,0), 'bedrock') => bedrock
|
||||||
set(block(0,5,0), 'bedrock') => bedrock
|
set(block(0,5,0), 'bedrock') => bedrock
|
||||||
scan(0,5,0,0,0,0,set(_,'bedrock')) => 1
|
scan(0,5,0,0,0,0,set(_,'bedrock')) => 1
|
||||||
set(pos(players()), 'bedrock') => bedrock
|
set(pos(player()), 'bedrock') => bedrock
|
||||||
set(0,0,0,'bedrock') => 0 // or 1 in overworlds generated in 1.8 and before
|
set(0,0,0,'bedrock') => 0 // or 1 in overworlds generated in 1.8 and before
|
||||||
scan(0,100,0,20,20,20,set(_,'glass'))
|
scan(0,100,0,20,20,20,set(_,'glass'))
|
||||||
// filling the area with glass
|
// filling the area with glass
|
||||||
@@ -255,7 +255,7 @@ and the same can be achieved with `query(entity,'pos')`, but for simplicity `pos
|
|||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
pos(block(0,5,0)) => l(0,5,0)
|
pos(block(0,5,0)) => l(0,5,0)
|
||||||
pos(players()) => l(12.3, 45.6, 32.05)
|
pos(player()) => l(12.3, 45.6, 32.05)
|
||||||
pos(block('stone')) => Error: Cannot fetch position of an unrealized block
|
pos(block('stone')) => Error: Cannot fetch position of an unrealized block
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
@@ -513,7 +513,7 @@ To check if a block is truly loaded, I mean in memory, use `generation_status(x)
|
|||||||
outside of the playable area, just are not used by any of the game mechanic processes.
|
outside of the playable area, just are not used by any of the game mechanic processes.
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
loaded(pos(players())) => 1
|
loaded(pos(player())) => 1
|
||||||
loaded(100000,100,1000000) => 0
|
loaded(100000,100,1000000) => 0
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ place of the resulting map element, otherwise current element is skipped.
|
|||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
map(range(10), _*_) => [0, 1, 4, 9, 16, 25, 36, 49, 64, 81]
|
map(range(10), _*_) => [0, 1, 4, 9, 16, 25, 36, 49, 64, 81]
|
||||||
map(players('*'), _+' is stoopid') [gnembon is stoopid, herobrine is stoopid]
|
map(player('*'), _+' is stoopid') [gnembon is stoopid, herobrine is stoopid]
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
### `filter(list,expr(_,_i))`
|
### `filter(list,expr(_,_i))`
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ $ )
|
|||||||
$ );
|
$ );
|
||||||
$ lvl
|
$ lvl
|
||||||
$);
|
$);
|
||||||
/script run global_get_enchantment(players(), 'sharpness')
|
/script run global_get_enchantment(player(), 'sharpness')
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
### `Basic Arithmetic Operators + - * /`
|
### `Basic Arithmetic Operators + - * /`
|
||||||
|
|||||||
Reference in new issue
Block a user