Created
February 12, 2022 17:20
-
-
Save corarona/19dc1582baadebd4699cc4e6ccbc06b9 to your computer and use it in GitHub Desktop.
mobtest - spawns all mobs in mcl2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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