Detecting when a Splash Potion hits a block

Started by Bre3ezyy on

Topic category: Help with Minecraft modding (Java Edition)

Joined Nov 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Detecting when a Splash Potion hits a block

So, I'm creating a mod for my friend's server, and he wants me to add "purification potions" that can turn mycelium into grass

I was wondering if it is possible to detect when a splash potion hits a specific block? The only thing I can think of is maybe finding where the potion entity was just before dying/despawning and then detecting the blocks around it, but even then I'm not 100% sure how to go about it

Any help would be greatly appreciated!

Joined Mar 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Things Needed: Tooltips Plug…
Thu, 08/15/2024 - 19:18

Things Needed: Tooltips Plug-in

  1. Make the potion
  2. On tooltip rendering, if get nbt text tag of provided item stack = "[potion id (NOT POTION EFFECT, THE ACTUAL POTION ID. to find this go to the potion element, right click and click edit regristry name and it will show)]" then replace item with custom splash potion
  3. For the projectile hitting block, use How to teleport when ranged projectile hits a block | MCreator. but instead of teleport, do what you want
Joined Mar 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
i got it wrong, i meant if…
Thu, 08/15/2024 - 19:21

i got it wrong, i meant if get nbt text tag "Potion" = "[potion id]"