Help With Potion of Serenity

Started by StitchesMC on

Topic category: Help with Minecraft modding (Java Edition)

Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Help With Potion of Serenity

Hello, I have been trying to add a new potion to MCreator called the potion of serenity. Essentially, its a potion that will prevent mob spawns around the player with this effect. The stronger the potion, the larger the radius of where mobs can't spawn. The closest I have gotten to getting this to work is changing the player's difficulty to peaceful, but that comes with its own set of problems. For example, I still want mobs to spawn, just not within like a 30 block radius, and I still want to player to lose hunger and not regenerate crazy fast. Anybody have any ideas on how I can make this work? I feel like I've tried everything, granted I'm fairly new to the modding scene. Thank you for any help, it is much appreciated! <3

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
There may be a better way,…
Sun, 04/21/2024 - 22:42

There may be a better way, but you could use "for each entity as entity iterator ... in square cube with size _" and then put a despawn entity block inside of it and make that procedure run every tick while the potion is on. you can also easily change the radius like you said with the potion levels