Add xp command for debug and server admins
This commit is contained in:
parent
34e17cae6c
commit
0cf9e712d3
@ -94,7 +94,20 @@ minetest.register_node("enchanting:table", {
|
||||
clicker:set_wielded_item(stack)
|
||||
end,clicker)
|
||||
end
|
||||
})
|
||||
})
|
||||
|
||||
minetest.register_chatcommand("xp", {
|
||||
params = "nil",
|
||||
description = "Spawn x amount of a mob, used as /spawn 'mob' 10 or /spawn 'mob' for one",
|
||||
privs = {server = true},
|
||||
func = function(name)
|
||||
local player = minetest.get_player_by_name(name)
|
||||
local pos = player:get_pos()
|
||||
|
||||
|
||||
minetest.throw_experience(pos, math.random(200,300))
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
|
Loading…
x
Reference in New Issue
Block a user