Multiple entity affecting

Started by Rednax on Sat, 10/10/2020 - 02:37

Topic category: Help with MCreator software

Last seen on 20:57, 22. Nov 2020
Joined Jan 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Multiple entity affecting
Sat, 10/10/2020 - 02:37

I wish to make a sword with a lifesteal effect on it. Basically, this means you get Regeneration for a short time after hitting entities. The problem is, I need a way to give Regeneration to the player, upon hitting a non-player entity, such as a zombie.

Last seen on 11:10, 23. Nov 2020
Joined Aug 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
If you use the global Entity…
Sat, 10/10/2020 - 15:00

If you use the global Entity attacked trigger it will give you the entity who attacked in the Source entity and the entity who was attacked in the Event/target entity. You'll need to check if the Source entity is a player and if it is holding the sword in its hand, and if you want you can check if the Event/target entity is a zombie or other type of mob to make it specific. There's a block in the Entity procedures called Add potion with level _ and duration _ to _ type _, which you can use to give the Source Entity regeneration. You could also use the When living entity is hit with tool trigger in the sword's triggers in much the same way.