Solved Setting A Clicked Item's Name To A Variable

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

Lanchester

New Member
Jan 14, 2018
9
0
0
27
Ok, so for some background, I'm currently working on a waypoint system for my server, where there's a large room at spawn with the entire floor made up of maps on item frames, and ideally if someone were to click on a specific map tile they would teleport to a spot on that tile. The best way I could think of to make this work without having to write an argument for each individual map name is to set the name of the clicked map to a variable and then teleport the player to coordinates based off of the map name (so for example if they clicked on a level 2 map named "3 8" they would be teleported to X:1536 Y:4096.) The problem I'm having though is that I can't for the life of me figure out how to store a clicked item's name as a variable. Because it's an item frame I'm clicking and not the map itself I'll probably have to settle for naming the frame instead, which is fine, but the only expression I could find that might apply to this is "clicked item" but Skript gives me an error on load stating that this expression is only meant for clicking in an inventory, yet the "on rightclick" trigger I'm using works fine, so I'm kind of lost. If anyone could point me in the direction of an addon or expression that can handle this situation I'd greatly appreciate it.
[doublepost=1549267395,1549017768][/doublepost]Update: I could still really use help, but I wanted to post all the things I've tried that don't work, as well as the addons I'm using. I can't use "clicked item" because that only refers to items in an inventory. I can't use "event-item" because that refers to the item in my hand when I click on the frame, not the frame itself. I tried calling for the CustomName NBT tag using Skellet, but either I don't know the proper syntax for it or it doesn't work in this situation. I've tried copying the item to an empty slot in my inventory so that I could possibly use "event-item" on the cloned item frame but it doesn't seem to like that when used on a block placed in the world. I combed through every placeholder from placeholderapi thinking that surely one of them must call for an item's name but as far as I can tell none of them do. I've combed through every forum post I can find that even mentions item names and they all refer to renaming an item in an inventory. I've thought of so many different ways I can get this to work, but virtually all of them require gathering the name of the item I want to interact with, and I just can't find any way at all to do something I thought would be extremely simple. I feel like I'm just missing some stupidly obvious expression, I mean surely this situation has come up before.

Addons I'm using:
Skellet
SkQuery
skUtilities
TuSKe
Ersatz
 
!!! You just saved my life man. Thank you! I even tried event-entity, but I didn't even think about searching for an expression that calls for the item in an item frame. Wow I knew it was something simple I was missing but I feel a bit dumb now lol
 
Status
Not open for further replies.