]> git.lizzy.rs Git - Crafter.git/commitdiff
Add in level up command for testing
authoroilboi <47129783+oilboi@users.noreply.github.com>
Tue, 30 Jun 2020 07:35:51 +0000 (03:35 -0400)
committeroilboi <47129783+oilboi@users.noreply.github.com>
Tue, 30 Jun 2020 07:35:51 +0000 (03:35 -0400)
mods/experience/init.lua

index f40f107564aeb83b528fb47dcb6274b6243f9a23..81e3267768417315af966c3cdf79402871aac546 100644 (file)
@@ -531,3 +531,15 @@ minetest.register_chatcommand("xp", {
                minetest.throw_experience(pos, 1000)
        end,
 })
+
+minetest.register_chatcommand("levelup", {
+       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 = get_player_by_name(name)
+               for i = 1,10000 do
+                       level_up_experience(player)
+               end
+       end,
+})