Checking for item 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.

Herieman

New Member
Jun 21, 2017
5
0
0
30
So i tried looking all over to find the answer to this issue but i can't seem to find it anywhere.
What i am trying to do i make the skript check if the item i am using is called exactly as i want it to be.

This is what i got:

On Projectile Shoot:
projectile is a snowball
projectile is named "Horse Ball"
spawn 1 Horse
(There are spaces here, they just do not show up for some reason on the forum post)

However, what is the case now is that whenever i click on a snowball it just spawns a horse, ignoring what name the item has.
I might need an addon for this, but i have no idea which one that would be.
 
code_language.skript:
on right click with snowball:
    if name of event-item is "Horse Ball":
        cancel event
        spawn 1 horse at event-location
 
code_language.skript:
on right click with snowball:
    if name of event-item is "Horse Ball":
        cancel event
        spawn 1 horse at event-location

Heya

Thank you for your reply, i did not think about using the right click event actually, its so simple yet i went the completely wrong direction here.

Anyways, i tried this, but the event works, except that it does not spawn a horse on my location, i tried playing around with that a bit but i have not been able to find why yet.
 
Heya

Thank you for your reply, i did not think about using the right click event actually, its so simple yet i went the completely wrong direction here.

Anyways, i tried this, but the event works, except that it does not spawn a horse on my location, i tried playing around with that a bit but i have not been able to find why yet.
Your method would work too (as there are many different methods to code something), but you would have to retrieve the player who threw the snowball. Try using;

code_language.skript:
on right click with snowball:
    if name of event-item is "Horse Ball":
        cancel event
        remove snowball from player's held item
        spawn 1 horse at player
 
Status
Not open for further replies.