cybervision
Member
Posts: 31 Joined: Wed Jan 10, 2018 05:45
GitHub:
tonsb
In-game: cybervision
by cybervision » Sat May 19, 2018 05:40
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}
}
}
})
Krock
Developer
Posts: 4652 Joined: Thu Oct 03, 2013 07:48
GitHub:
SmallJoker
Location: Switzerland
Contact:
by Krock » Sat May 19, 2018 09:20
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
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:
by TumeniNodes » Sat May 19, 2018 22:20
Post
sorry for the [offtopic] but, I thought this was a thread 'bout me mother-in-law
carry on chaps
A Wonderful World
Users browsing this forum: No registered users and 6 guests