Increase potion effect level every time

Started by Delangel on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Increase potion effect level every time

Hi, I am trying to make a procedure that can increase the current level of potion effect (Every so often with ticks or right click) is this possible?

 

Ícono de validado por la comunidad

 

 


 

Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yes, it is possible, just…
Tue, 08/08/2023 - 21:05

Yes, it is possible, just make a procedure with a global trigger "On player tick update" (alternatively you can do it on every loaded entity instead of just players), detect if the entity has the potion (optional, I think it works without this), store the duration and level in variables, add 1 to the level variable, clear that specific effect and apply it with the variables as duration/level

I didn't test this but in theory this should work. And for right click you can do the same but without that global trigger.

Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Oh, also make it a chance or…
Tue, 08/08/2023 - 21:06

Oh, also make it a chance or base it off a timer (stored in custom NBT for example)

Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thanks a lot, i was trying…
Wed, 08/09/2023 - 00:48

Thanks a lot, i was trying to make with right click, In case it's not too much trouble, could you give me an example of the procedure? Thanks in advance

 

Ícono de validado por la comunidad


 

Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I don't know how to send a…
Wed, 08/09/2023 - 19:47

I don't know how to send a screenshot, so I'll just tell you what to do in text: First, make a "When right-clicked" procedure to your item. Then, make the 2 local number variables, I'll call them "amplifier" and "duration" here. Next make this code:

Set Local: amplifier to: Get effect level/amplifier of potion (your potion) for Event/target entity
Set Local: duration to: Get remaining ticks of potion (your potion) for Event/target entity
Remove specific potion effect (your potion) from Event/target entity
Add potion (your potion) with level [Get Local: amplifier + 1] for [Get Local: duration] ticks ambient (true/false) particles (true/false) to Event/target entity

Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thanks bro! it helps me a…
Sun, 08/13/2023 - 06:42

Thanks bro! it helps me a lot!