Skip to content

Instantly share code, notes, and snippets.

@corarona
Created February 12, 2022 17:20
Show Gist options
  • Save corarona/19dc1582baadebd4699cc4e6ccbc06b9 to your computer and use it in GitHub Desktop.
Save corarona/19dc1582baadebd4699cc4e6ccbc06b9 to your computer and use it in GitHub Desktop.
mobtest - spawns all mobs in mcl2
math.randomseed(os.time())
minetest.register_chatcommand("mobtest",{
description="Spawns all available mobs",
privs={server=true},
func=function(n,param)
local p=minetest.get_player_by_name(n)
local pos=p:get_pos()
for k,v in pairs(minetest.registered_entities) do
if v.horny ~= nil then
local spos=vector.add(pos,vector.new(math.random(100)+10,0,math.random(100)+10))
minetest.add_entity(spos, v.name)
end
end
end})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment