broken battle axe

Post Reply
cybervision
Member
Posts: 31
Joined: Wed Jan 10, 2018 05:45
GitHub: tonsb
In-game: cybervision

broken battle axe

by cybervision » Post

i am triyng to get a battle axe that hurts people 5 hp
but its not working

Code: Select all

minetest.register_tool("extra_swords:battle_axe", {
    description = "Battle Axe",
    inventory_image = "extra_swords_battle_axe.png",
    tool_capabilities = {
        max_drop_level = 3,
        groupcaps = {
            fleshy = {times = {5}, uses=70, maxlevel=1}
        }
    }
})

User avatar
Krock
Developer
Posts: 4652
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: broken battle axe

by Krock » Post

The "fleshy" group is different to the other groups, which are used to dig nodes. When you damage entities or players with swords or axes, your tool currently only wears out when there's a mod which adds the damage manually after a hit.
To make the damage working, put the "fleshy" group like this into the "damage_groups" table:

Code: Select all

	tool_capabilities = {
		max_drop_level = 3,
		groupcaps = {
			-- Node digging specs, example:
			--choppy={times={[1]=2.3, [2]=1.5, [3]=1.0}, uses=20, maxlevel=1}
		}
		damage_groups = {fleshy = 5}
	}
Example from Minetest Game: https://github.com/minetest/minetest_ga ... /tools.lua
Example in lua_api.txt: https://github.com/minetest/minetest/bl ... 1863-L1870
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

cybervision
Member
Posts: 31
Joined: Wed Jan 10, 2018 05:45
GitHub: tonsb
In-game: cybervision

Re: broken battle axe

by cybervision » Post

cool thanks

User avatar
TumeniNodes
Member
Posts: 2943
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes
Location: in the dark recesses of the mind
Contact:

Re: broken battle axe

by TumeniNodes » Post

sorry for the [offtopic] but, I thought this was a thread 'bout me mother-in-law

carry on chaps
A Wonderful World

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests