Variables only working if it is singular 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 community!

    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!

J1nx

Member
Jan 8, 2023
1
0
1
When I have more than one of the items in an item stack, it does not work.

Code:
command /itemset:

  permission: op

  trigger:

    set {customItems::feather} to player's tool

    send "%{customItems::feather}%"&r set to player



on right click:

  if player's tool is feather:

    player's tool contains {customItems::feather}

    cancel event

    push player forward at speed 1.25

    remove 1 of tool from tool
 
Last edited:
When I have more than one of the items in an item stack, it does not work.

Code:
command /itemset:

  permission: op

  trigger:

    set {customItems::feather} to player's tool

    send "%{customItems::feather}%"&r set to player



on right click:

  if player's tool is feather:

    player's tool contains {customItems::feather}

    cancel event

    push player forward at speed 1.25

    remove 1 of tool from tool
Try: If type of player's tool is feather. Alternatively, just check the name of player's tool or NBT data and that way you always know it's at least one feather instead of only one or a specified stack size.