Solved How do you remove cursor AMOUNT item?

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

BrownMee

Active Member
Apr 16, 2018
126
6
18
23
I tried numerous codes but still doesn't work.

code_language.skript:
remove 1 from cursor slot of player

Is there any other code that allows me to remove a specific amount from the cursor
 
I tried numerous codes but still doesn't work.

code_language.skript:
remove 1 from cursor slot of player

Is there any other code that allows me to remove a specific amount from the cursor
I dont think you can remove items on wich slot the cursor is, but you can remove if you click on it
 
i think you can do something like

code_language.skript:
set {_item} to cursor slot of player
remove 1 of {_item} from player
 
Could you please give an example of your code? Just so we can see exactly how you are handling it, and try to help you make it work.
 
Could you please give an example of your code? Just so we can see exactly how you are handling it, and try to help you make it work.
Ahh sure
code_language.skript:
on mor.inventory click:
    player's tool is any pickaxe or shovel or axe:
        player's cursor slot is nether_star:
            name of player's cursor slot is "&fDurability Fragment":
                if event-item is player's tool:
                    cancel the event
                    set {_item} to cursor slot of player
                    remove 1 of {_item} from player
                    repair player's tool by 10
                    wait 2 ticks
                else:
                    send "&fPlease hold the item you want to fix and drag the fragment to it."
 
okay.... so 2 things.

#1 - The code to remove the item is
code_language.skript:
remove 1 of player's cursor slot from player's cursor slot
#2 - I think the code you have here is a little conflicting in itself.
I re-wrote it a bit to make it work
code_language.skript:
on inventory click:
    if clicked item is any pickaxe or shovel or axe:
        player's cursor slot is nether_star:
            name of player's cursor slot is "&fDurability Fragment":
                if clicked item is player's tool:
                    cancel the event
                    remove 1 of player's cursor slot from player's cursor slot
                    repair player's tool by 10
                    wait 2 ticks
                else:
                    send "&fPlease hold the item you want to fix and drag the fragment to it."
 
You're welcome... glad to help :emoji_thumbsup:
I got 1 more thing to ask. How do you detect how much durability is there in your player tool? I tried

if the data value of the player's tool is less than 1:

Doesn't seems like working.
 
that is the correct format, but NOT SURE WHY.... the data value of damage is actually backwards in skript
so 1 would represent only 1 damage has been done to the tool, IE: diamond pick has a durability of 1561, meaning "data value of player's tool" being 1.... would mean the durability is still 1560/1561
 
That's not it being "backwards in Skript", that's just how it works in vanilla as well. You can also use "damage of <item>".

Note that in 1.13 data values will no longer exist and all damage values have been migrated to an NBT tag.
 
Status
Not open for further replies.