Multiple entity affecting

Started by Rednax on

Topic category: Help with MCreator software

Active 4 years ago
Joined Jan 2020
Points:
840

User statistics:

  • Modifications: 5
  • Forum topics: 14
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 184
Multiple entity affecting

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.

Active 2 years ago
Joined Aug 2020
Points:
697

User statistics:

  • Modifications: 1
  • Forum topics: 7
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 112
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.