I want to make it so that when a player eats a carrot named "&cCarrot" It gives them special effects

  • 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.
Aug 14, 2021
10
0
1
18
Hi! So I am writing a code right now that should give a player potion effects when eaten

Code:
on eat a carrot named "&cBlaze carrot":
apply potion of strength of tier 1 to player for 1000000000000000000 seconds
apply potion of regeneration of tier 1 to player for 1000000000000000000 seconds
apply potion of fire_resistance of tier 255 to player for 100000000000000000 seconds
apply potion of health_boost of tier 4 to player for 10000000000000000 seconds

when i run this however, it comes up with a error saying "Couldnt understand event on eat a carrot named "&cBlaze carrot"

Could this please be explained to me? Either comment under this thread or add me on Discord with The Last Cat Boy#5556 and help me please!

Thanks!
 
No, the error isnt the 10000000000 seconds, it says "Cant understand this condition: on eat a carrot named "&cBlaze Carrot"
 
Code:
on consume:
  if event item is carrot named "&cBlaze Carrot":
    apply potion of strength of tier 1 to player for 1000000000000000000 seconds
    apply potion of regeneration of tier 1 to player for 1000000000000000000 seconds
    apply potion of fire_resistance of tier 255 to player for 100000000000000000 seconds
    apply potion of health_boost of tier 4 to player for 10000000000000000 seconds
 
thanks! Ill test it out
[doublepost=1631098689,1631098486][/doublepost]Nope, it dosent work it says
cant compare "event item" with an item type

(Im on a mac could that make a difference)
 
That wouldn't make a difference it must be a code error.
[doublepost=1631107917,1631107854][/doublepost]
Code:
on consume:
  if player's tool is carrot named "&cBlaze Carrot":
    send "Test works"
try this
 
Names cann't be placed with the event as i know
Code:
on eat a carrot:
   if event-item's name is "&cBlaze carrot":
      apply potion of strength of tier 1 to player for 1000000000000000000 seconds
      apply potion of regeneration of tier 1 to player for 1000000000000000000 seconds
      apply potion of fire resistance of tier 255 to player for 100000000000000000 seconds
      apply potion of health boost of tier 4 to player for 10000000000000000 seconds
Try this. i didnt test it tho.
 
Status
Not open for further replies.