1.21.6 Skript/SkBee getting item 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!

TheRealCow

Member
Jun 27, 2025
2
0
1
My problem is actually very simple but I couldn't find a solution. I am making a market system, I designed a chest gui that can earn money by selling items and each person has a chest where they can market their own items. With a command like /shop look <player>, whatever, I set everything, like how the player will sell their items. I made a command, for example /shop sell <price> with this command you can sell the number of items you have with the price of each item. For example, let's say there is 1.5 stacks of wood, in this case it will be separated as 64 and 32. When I want to sell it, I sell it, but it is stored differently in the list. When I make a list of the items the user sells, I should only get oak_planks = 1, but I get the following output. oak_planks:0*64 = 1, oak_planks:0*32 = 1, in short, it perceives them differently. However, when I transfer them to the chest gui, I only need to get them as oak_planks.

In short, I want to get the name of the items, for example oak_planks, not oak_planks:0*45 or something like that. Because when I print them, I print accordingly. I left a part of my code below. Here I get a result like oak_planks:0*xx as output.
Code:
            if player's tool is not air:
                if arg-2 is set:
                    set {_amount} to amount of player's tool
                    send "players tool : %{_a}%, amount : %{_amount}%" to player
                    
                    marketAddItem(player,player's tool)
 
This isn't a good enough snippet of the code. I don't know what {_a} is. Please provide a better snippet, but another problem I see here is you're doing amount of player's tool instead of item amount of player's tool. Trust me, I learned that one the hard way.
 
This isn't a good enough snippet of the code. I don't know what {_a} is. Please provide a better snippet, but another problem I see here is you're doing amount of player's tool instead of item amount of player's tool. Trust me, I learned that one the hard way.
I solved the problem, if you want to get the name of any item variable you need to use this code so it doesn't tell you how many there are etc but just what it is.
Code:
set {_itemid} to type of player's tool
 
I solved the problem, if you want to get the name of any item variable you need to use this code so it doesn't tell you how many there are etc but just what it is.
Code:
set {_itemid} to type of player's tool
Ohh, I could actually use that information myself, thank you for sharing.