Detecting when a Splash Potion hits a block

Started by Bre3ezyy on

Topic category: Help with Minecraft modding (Java Edition)

Active 1 year ago
Joined Nov 2023
Points:
111

User statistics:

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

Active 6 days ago
Joined Mar 2024
Points:
86

User statistics:

  • Modifications: 0
  • Forum topics: 2
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 10
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
Active 6 days ago
Joined Mar 2024
Points:
86

User statistics:

  • Modifications: 0
  • Forum topics: 2
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 10
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]"