how do i make a procedure that when my sword hits the entity gets burned

Started by PEEP0_ on

Topic category: Help with MCreator software

Joined Feb 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
how do i make a procedure that when my sword hits the entity gets burned

i made a sword on my mod called helliron which is basically iron but its found in the nether. so i want to make a burning procedure so that when my sword hits the entity burns for 5 seconds

Joined Dec 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Fortunately, you can easily…
Fri, 02/26/2021 - 12:11

Fortunately, you can easily implement this in your mod with a few procedure blocks.

Essentially, what you have to do is to check before you hit an entity what item does the player hold in his hand? If it is a Helliron sword, then you apply burning on the entity for 5 seconds. You want this to trigger every time when you hurt an entity with your sword.

Code for a flames sword

This procedure trigger every time an entity is hurt, and if the source entity (the one who hurts the entity) has the sword in his hand (I've used a bone for trying out, replace the bone with your sword), it will set the entity in fire for 5 secs.

Hope that helped, also, try and learn to understand procedures, it goes a long way because it's an extremely powerful tool.

Keep on modding and have a nice day! :)