aboutsummaryrefslogtreecommitdiff
path: root/src/main/god_stick.lua
blob: a40553804823de65cec397ead63936b5f4009066 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
local groupcaps = {times = {0, 0, 0}, uses = 0, maxlevel = 3}

minetest.register_tool("skycraft:god_stick", {
    description = "God Stick",
    inventory_image = "mcl_mobitems_blaze_rod.png",
    range = 100,
    tool_capabilities = {
        max_drop_level = 1,
        groupcaps= {
            not_in_creative_inventory = groupcaps,
            oddly_breakable_by_hand = groupcaps,
            pickaxey = groupcaps,
            axey = groupcaps,
            shovely = groupcaps,
            fleshy = groupcaps,
        },
        damage_groups = {fleshy = 1000},
    }
})

minetest.register_on_punchplayer(function(player, hitter, time_from_last_punch, tool_capabilities, dir, damage)
	if hitter:get_wielded_item():get_name() == "skycraft:god_stick" then
		lightning.strike(player:get_pos())
		minetest.after(0.5, minetest.ban_player, player:get_player_name())
		return true
	end
end)