mirror of
https://notabug.org/TenPlus1/lucky_block.git
synced 2024-08-21 05:24:09 +02:00
spawning mobs works with tables or strings
This commit is contained in:
parent
241e25a8c3
commit
0cb46ab251
@ -23,5 +23,6 @@ Changelog:
|
|||||||
- 0.8 - Added wishing well with random block drops
|
- 0.8 - Added wishing well with random block drops
|
||||||
- 0.9 - Tweak item drops, add replacements to schematics, tidy wishing well code
|
- 0.9 - Tweak item drops, add replacements to schematics, tidy wishing well code
|
||||||
- 1.0 - Added ability for custom lucky blocks to use their own block list
|
- 1.0 - Added ability for custom lucky blocks to use their own block list
|
||||||
|
- 1.1 - Spawning mobs can now select randomly from a table or single string
|
||||||
|
|
||||||
Lucky Blocks: 253 (depending on mods enabled)
|
Lucky Blocks: 253 (depending on mods enabled)
|
||||||
|
6
api.txt
6
api.txt
@ -204,12 +204,12 @@ Spawn Entity or Mob
|
|||||||
|
|
||||||
This command allows you to place a monster, animal or other entity.
|
This command allows you to place a monster, animal or other entity.
|
||||||
|
|
||||||
{"spw", "entity name", how many to spawn, tamed, owned, range, nametag}
|
{"spw", {"entity name"}, how many to spawn, tamed, owned, range, nametag}
|
||||||
|
|
||||||
e.g.
|
e.g.
|
||||||
|
|
||||||
Spawn 2x Dirt Monsters over a radius of 10 blocks
|
Spawn 2x Dirt or Stone Monsters over a radius of 10 blocks
|
||||||
{"spw", "mobs:dirt_monster", 2, nil, nil, 10}
|
{"spw", {"mobs:dirt_monster", "mobs:stone_monster"}, 2, nil, nil, 10}
|
||||||
|
|
||||||
Spawn 5x randomly coloured sheep (random colour only works with Mobs Redo sheep)
|
Spawn 5x randomly coloured sheep (random colour only works with Mobs Redo sheep)
|
||||||
{"spw", "mobs:sheep", 5}
|
{"spw", "mobs:sheep", 5}
|
||||||
|
9
init.lua
9
init.lua
@ -286,7 +286,14 @@ local lb_spawn = function(pos, digger, def)
|
|||||||
|
|
||||||
if nodef and nodef.walkable == false then
|
if nodef and nodef.walkable == false then
|
||||||
|
|
||||||
local entity = def[2]
|
local entity
|
||||||
|
|
||||||
|
-- select between random or single entity
|
||||||
|
if type(def[2]) == "table" then
|
||||||
|
entity = def[2][math.random(1, #def[2])]
|
||||||
|
else
|
||||||
|
entity = def[2]
|
||||||
|
end
|
||||||
|
|
||||||
-- coloured sheep
|
-- coloured sheep
|
||||||
if entity == "mobs:sheep" then
|
if entity == "mobs:sheep" then
|
||||||
|
Loading…
Reference in New Issue
Block a user