Closed C1ffisme closed 6 years ago
:+1: My usecase would be for an experience system, so fighting skills could be assessed.
@0-afflatus That's another good idea... Since the stuff in minetest usually doesn't drop on the ground.
Adding to my comment about enchantments, I found out about newlines in item descriptions, so these could easily go together to make a minecraft-like enchantment system. (Based off metadata, rather than tool definition from a different ID)
This is related to #3615 if not a dupe
@0-afflatus That is completely different. That is an issue on how fighting enemies with swords does not wear them. This is a feature request on giving us the ability to detect any time an entity has been punched by a player.
Actually, this could be counted as a solution for #3615.
Actually, this could be counted as a solution for #3615.
So it's related, see sofar's comment.
Okay... So it's related. It's still not a duplicate. (Erm... At least... Not an exact duplicate.)
Any core dev support?
IMO we don't need the same function twice. on_punch
already exists in the entity definition - and can be used to trigger an effect which is entity-specific. Overriding and/or extending that callback is no big deal if multiple types of entities should act the same way.
The major problem with such a callback is that the use of entities vary a lot - some are used as letters on signs, as falling nodes or for display purposes in item frames. Setting those on fire can cause undesired side-effects with those mods who will try to restore the entities as soon they're burnt.
EDIT: Add spacing. Long tests are tiring.
Currently, we have a global way to detect if you punched a node.
But we do not have one to globally detect if you have punched an entity.
An ideal usecase for this is to e.g. set a mob on fire if the puncher's sword's meta variable 'Fire' is set to true. (Or remove more health if the sword's 'Sharp' is true or if the player has the 'Strength' effect.)