Solved "set name of event-item to [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.

CrimZ0N

Member
Jan 28, 2017
56
3
8
24
Skript Version: Bensku's latest fork (dev30d)
Skript Author:
Minecraft Version:
1.12
---
Full Code:

code_language.skript:
on item spawn of sunflower:
    if name of event-item is "&e&lCoin":
        stop
    else:
        add "{Item:{tag:{display:{Name:""&e&lCoin""}}}}" to nbt of entity

Errors on Reload: Can't understand this condition/effect: add "{Item:{tag:{display:{Name:""&e&lCoin""}}}}" to nbt of entity (MarioMode.sk, line 12: add "{Item:{tag:{display:{Name:""&e&lCoin""}}}}" to nbt of entity')

Other Useful Info: Dunno, I was looking through old scripts because I needed something like this, found this in a couple of other scripts (not just 1 or 2 lines, around 60 lines of it being used) so I assumed it worked but I guess an update or something broke it?

Addons using (including versions):
Addons I am using are AdvancementAddon, SkEvents, MundoSk, QuarSk, SharpSk, Skellett, SkMorkaz, SkQuery, SkRayfall, SkStuff, SkUtilities, Tuske, Umbaska, Vixio and WildSkript. They've all been updated to the latest version (latest version available) around 4-5 days ago.

Troubleshooting:

Have you tried searching the docs? Yes I have.
Have you tried searching the forums? Yes.
What other methods have you tried to fix it? I tried "set name of event-entity" and "set the name of the spawned entity(or item) to "&e&lCoin"" but neither of them worked, sadly.



So, I need help. How do I set the name of an item during an "on item spawn" event? Did I do it wrong? I assume I did since I didn't quite test the skripts (skripts I was using quite some time ago), I just copied that part since I needed it and pasted it since thats all I neede.
 
You need to use
code_language.skript:
event-entity
instead of:
code_language.skript:
event-item
:emoji_grinning:

So try using:
code_language.skript:
on item spawn of sunflower:
    if name of event-item is "&e&lCoin":
        stop
    else:
        set the name of the event-entity to "&e&lCoin"
 
Whilst I am not getting any errors, the item is not being renamed, sadly.
[doublepost=1502902490,1502901713][/doublepost]Oh, nevermind, fixed it, it was due to the incorrect version (I guess I didn't have all the latest versions for the addons)

Solution for anyone else (if they encounter the same problem/error)
Make sure the versions are compatible. I am using paperSpigot 1.12 alongside SkStuff v1.6.4.1 fork 1.12
 
Status
Not open for further replies.