[TUTORIAL] Enchantment Inflicting Potion Effects

Started by Pizz4Ninja on

Topic category: User side tutorials

Last seen on 02:14, 1. Jul 2024
Joined Jan 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
[TUTORIAL] Enchantment Inflicting Potion Effects
Sun, 06/30/2024 - 20:32 (edited)

SUPPORTS MCREATOR 2023.4 RELEASE

Hello!

Today I'm going to show you how to make a custom enchantment that inflicts potion effects to the entity you hit! (It will also support different effects for different levels) ❤️


Creating the Enchantment

Go in MCreator and make a new Enchantment element with whatever name you'd like (For example you could name it: "Inflicting")

Element

 

Change any properties how you wish (For example, what it can be applied to!) 🔓

Once you've created your Enchantment element and adjusted it to your liking press the "Save mod element" button! ✅


Coding the Inflicting Procedure

First create a new procedure and name it something along the lines of "InflictingProcedure" 🖥️

Procedure

This will not be "linked" anywhere in the enchantment element or any other element as the procedure has a global check. Once the global trigger is triggered it checks for the enchantment 💻

The procedure is currently an example of something very simple that works with undead and normal mobs with no extra conditionals

 

Global Trigger: Entity Attacked

Second = 20 Ticks, Minute = 1200

 

Make sure the red things are connected to Source entity and not event/target entity! You can get Source entity in the Minecraft Components procedure tab!

 

This example procedure checks for:

  • When entity is attacked
    • If has enchantment
    • What hand is item with enchantment held in
    • What level is the enchantment in the hand

When everything is checked it gives the entity that attacked you the potion effect, the next level gives the same potion effect with a higher level and another potion effect! 📃

 

Keep in mind that undead mobs have the opposite effect from debuffs, so harming heals them. I recommend having checks for what mob attacked you and gives the effect accordingly! 👾

 

To make it check for undead mobs use a check Is Event/target entity creature type UNDEAD (If you need more help with this comment or message me on Discord: pizz4ninja!)


 

Thank you for reading this post! If you need help feel free to comment ❤️

Edited by Pizz4Ninja on Sun, 06/30/2024 - 20:32
Last seen on 10:35, 30. Jun 2024
Joined Jan 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
tysm!
Sat, 06/29/2024 - 22:25

tysm!

Last seen on 20:33, 30. Jun 2024
Joined Jan 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
sure thing! 
Sun, 06/30/2024 - 00:51

sure thing!