How do I make events occur based on food and its name?

  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Computerize

Member
Oct 10, 2019
38
0
0
23
How can I make an event occur based on a type of food and its name.

For example if I eat a golden apple how can I clear the effects of that and give speed 2 instead.
And if eat normal apples named &cHealth Apple (only with this specific name the event occurs) it will give the player healthboost 1.
 
How can I make an event occur based on a type of food and its name.

For example if I eat a golden apple how can I clear the effects of that and give speed 2 instead.
And if eat normal apples named &cHealth Apple (only with this specific name the event occurs) it will give the player healthboost 1.
try
Code:
on eating of golden apple:
    wait 1 tick
    remove regeneration from the player
    remove Absorption from the player
    apply speed to the player for 2 seconds
 
try
Code:
on eating of golden apple:
    wait 1 tick
    remove regeneration from the player
    remove Absorption from the player
    apply speed to the player for 2 seconds
anyway to make it for a specific name of an item because i am planning on making multiple types of golden apples.
 
Status
Not open for further replies.