Random Effect each time a golden apple is eaten

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

PotteryTNT

Member
Jul 21, 2017
41
0
0
22
Category: UHC

Suggested name: Gapple Roulette

Spigot/Skript Version: Spigot 1.8.8, Skript 2.2

What I want:
A skript that makes it so each time you eat a golden apple, it gives you a random effect with the regeneration still coming though. It could be for example the wither effect + the 4 seconds of regen 2 and 2min absorption.
It can give you ANY effect in the game, no exceptions.


Ideas for commands:
/gappleroulette on/off
Ideas for permissions:
gapple.uhc
When I'd like it by: A week.
 
not possible with skript yet as bensku is very slow
Why should this not be possible? Maybe 1 or 2 effects might not work didnt check but why should it not work.
[doublepost=1583401090,1583399870][/doublepost]
Category: UHC

Suggested name: Gapple Roulette

Spigot/Skript Version: Spigot 1.8.8, Skript 2.2

What I want:
A skript that makes it so each time you eat a golden apple, it gives you a random effect with the regeneration still coming though. It could be for example the wither effect + the 4 seconds of regen 2 and 2min absorption.
It can give you ANY effect in the game, no exceptions.


Ideas for commands:
/gappleroulette on/off
Ideas for permissions:
gapple.uhc
When I'd like it by: A week.


Code:
on consume of notch apple:
    set {_effects::*} to all potions
    set {_amount} to 1 #set {_amount} to random integer between 1 and 3
    loop {_amount} times:
        set {_tier} to a random integer from 1 to 5
        set {_time} to random integer from 1 to 120 #seconds
        set {_time} to "%{_time}% seconds" parsed as a time span
        set {_potion} to a random element out of {_effects::*}
        apply potion of {_potion} potion of tier {_tier} to player for {_time}