1
0
Fork 0

Spawn hoglins in stable bullwarks

turtlestriderbeefox
cora 2022-10-28 00:07:23 +02:00
parent 4ad1abde14
commit 62f353d54f
1 changed files with 19 additions and 16 deletions

View File

@ -22,13 +22,26 @@ mcl_structures.register_structure("nether_outpost",{
mcl_mobspawners.setup_spawner(sp[1], "mobs_mc:blaze", 0, minetest.LIGHT_MAX+1, 10, 8, 0)
end
})
local function spawn_mobs(mob,spawnon,p1,p2,pr,n)
n = n or 1
local sp = minetest.find_nodes_in_area_under_air(p1,p2,spawnon)
if sp and #sp > 0 then
for i=1,n do
local pos = vector.offset(sp[pr:next(1,#sp)],0,1,0)
if pos then
minetest.add_entity(pos,mob)
end
end
end
end
mcl_structures.register_structure("nether_bulwark",{
place_on = {"mcl_nether:netherrack","mcl_crimson:crimson_nylium","mcl_crimson:warped_nylium","mcl_blackstone:basalt","mcl_blackstone:soul_soil","mcl_blackstone:blackstone","mcl_nether:soul_sand"},
fill_ratio = 0.01,
chunk_probability = 600,
flags = "all_floors",
biomes = {"Nether","SoulsandValley","WarpedForest","CrimsonForest"},
sidelen = 32,
sidelen = 36,
solid_ground = true,
make_foundation = true,
y_min = mcl_vars.mg_lava_nether_max - 1,
@ -50,21 +63,11 @@ mcl_structures.register_structure("nether_bulwark",{
construct_nodes = {"group:wall"},
after_place = function(pos,def,pr)
if not peaceful then
local p1 = vector.offset(pos,-10,0,-10)
local p2 = vector.offset(pos,10,24,10)
local sp = minetest.find_nodes_in_area_under_air(p1,p2,{"mcl_blackstone:blackstone_brick_polished"})
if sp and #sp > 0 then
for i=1,5 do
local pos = vector.offset(sp[pr:next(1,#sp)],0,1,0)
if pos then
minetest.add_entity(pos,"mobs_mc:piglin")
end
end
local pos = vector.offset(sp[pr:next(1,#sp)],0,1,0)
if pos then
minetest.add_entity(pos,"mobs_mc:piglin_brute")
end
end
local p1 = vector.offset(pos,-14,0,-14)
local p2 = vector.offset(pos,14,24,14)
spawn_mobs("mobs_mc:piglin",{"mcl_blackstone:blackstone_brick_polished","mcl_stairs:slab_blackstone_polished"},p1,p2,pr,5)
spawn_mobs("mobs_mc:piglin_brute",{"mcl_blackstone:blackstone_brick_polished","mcl_stairs:slab_blackstone_polished"},p1,p2,pr)
spawn_mobs("mobs_mc:hoglin",{"mcl_blackstone:nether_gold"},p1,p2,pr,4)
end
end,
loot = {