1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Unstealable inventory slot

Discussion in 'Skript' started by mel_instagibson, Apr 1, 2017.

Thread Status:
Not open for further replies.
  1. mel_instagibson

    Joined:
    Feb 4, 2017
    Messages:
    71
    Likes Received:
    4
    Could anyone tell me if its intended that the "format slot" expression cant be used with on inventory click events and why that is?
    "set slot" works tho but that one doesnt have an unstealable option so i always have to cancel the event

    like on below i can detect inventory click events on any of the emerald blocks (buy coins) but wont get any result if i try the grass blocks (sell coins)

    This isnt much of a question for help but rather if i should report a bug or not because i can work around it by cancelling the inventory click event, i just really like the convenience of "to be unstealable"

    Code (Skript):
    1. on right click on nitwit:
    2.     player has permission "*"
    3.     cancel event
    4.     send "test" to the player
    5.     send "%name of clicked entity%" to the player
    6.     send "%villager job of clicked entity%" to the player
    7.     set name of clicked entity to "&eCoin Merchant"
    8.     wait 1 tick
    9.     close player's inventory
    10.     open chest with 1 row named "&eCoin Exchange" to player
    11.     wait 1 tick
    12.     format slot 0 of player with black_stained_glass_pane named " " to be unstealable
    13.     set slot 1 of player's current inventory to glowing emerald named "&aBuy 1 Coin for" with lore "&a100 Claim Blocks"
    14.     set slot 2 of player's current inventory to glowing emerald_block named "&aBuy 10 Coins for" with lore "&a1000 Claim Blocks"
    15.     set slot 3 of player's current inventory to glowing emerald_block named "&aBuy 64 Coins for" with lore "&a6400 Claim Blocks"
    16.     format slot 4 of player with black_stained_glass_pane named " " to be unstealable
    17.     format slot 5 of player with grass named "&6Sell 1 Coin for" with lore "&6100 Claim Blocks" to be unstealable
    18.     format slot 6 of player with grass named "&6Sell 10 Coins for" with lore "&61000 Claim Blocks" to be unstealable
    19.     format slot 7 of player with grass named "&6Sell 64 Coins for" with lore "&66400 Claim Blocks" to be unstealable
    20.     format slot 8 of player with black_stained_glass_pane named " " to be unstealable
     
Thread Status:
Not open for further replies.

Share This Page

Loading...