On Item Spawn (Name Problem)

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

Oliv583c

Member
Jan 11, 2021
13
0
1
18
Hello! I am in the middle of creating a skript. But I have a bit of a problem with some item spawning. I am trying to check if the item has a specific name. But it always returns "dropped item" or "item stack".

I have searched a lot on this subject and also found some solutions. But for some reason I just can't get them to work for me. And I'm also really new in this area (Talking about the addon skript-mirror).

on item spawn:
event-entity.setCustomNameVisible(true);
event-entity.setCustomName(event-entity.getItemStack().getItemMeta().getDisplayName() ? "%event- entity.getItemStack()%");

That's the code I found from 2 different threads. But I just can't get it to work. I use the following addons:
Skript(Obviously), SkQuery, Skrayfall, Skellett and Skript-mirror. I also use spigot 1.8.8. Got a solution or just know the answer?
 
Last edited:
code_language.skript:
on item spawn:
   set {_item} to event.getEntity()
   {_item}.setCustomNameVisible(true)
   {_item}.setCustomName("test")
 
Hey! Thanks for the reply. But for some reason code like this just cannot activate... Here is what I mean:

It just says it's not an entity type. And the CustomNameVisible is not a boolean... It's almost as if skript-mirror isn't activated. I don't know what is really going on. Do you have to import some stuff or so? Cause I read something about skript-mirror. It's possible to import stuff like events and that. Do you have to import anything for that code to work? I have tried importing some other stuff to see what would happen. And it just puts up a whole lot of errors. Is it because skript-mirror just isn't activated or??
 
I just removed skript-mirror and replaced it with skript-reflect. But for some reason it just deactivates all my current skripts?
 
Status
Not open for further replies.