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.

Solved Adding items to minecart chest

Discussion in 'Skript' started by Aberforth, Jul 11, 2020.

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

    Aberforth Member

    Joined:
    Jun 14, 2019
    Messages:
    40
    Likes Received:
    2
    Hello,

    By right clicking an armor stand the player can open a GUI:

    Code (Text):
    1. on right click on entity:
    2.     if name of clicked entity is "container":
    3.         if {container_open::%event-entity%} is 0:
    4.             send action bar "&7Opened container" to player
    5.             open chest with 6 rows named "&fContainer" to player
    I would want the player to be able to add items to the GUI. I know I could do it if it was a chest:

    Code (Text):
    1. on right click on chest:
    2.     if player's tool is torch:
    3.         add 1 torch to event-block's inventory
    But what should I do to achieve the same effect with a GUI like above instead of an actual chest?
    --- Double Post Merged, Jul 13, 2020, Original Post Date: Jul 11, 2020 ---
    Any ideas?
     
  2. xCoini

    xCoini Member

    Joined:
    Apr 19, 2019
    Messages:
    14
    Likes Received:
    0
    Maybe this:
    Code (Text):
    1. set {Tool} to player's tool
    2. {Tool} is not air
    3. #stuff
     
  3. Aberforth

    Aberforth Member

    Joined:
    Jun 14, 2019
    Messages:
    40
    Likes Received:
    2
    Sorry, I don't get it, can you explain further? What am I supposed to put in #stuff ?
    --- Double Post Merged, Jul 14, 2020, Original Post Date: Jul 13, 2020 ---
    I decided to change the idea a little bit, instead of using an armor stand I'm gonna use a minecart chest. It has an inventory so I thought it'd be easier.
    Code (Text):
    1. on right click on minecart:
    2.     add 1 stick to the inventory of the clicked entity
    For some reason, this doesn't put items in the chest. Any ideas?

    Okay I tried this:

    Code (Text):
    1. on right click on minecart:
    2.     set {_e} to event-entity
    3.     add 1 stick to {_e}'s inventory
    And it works so I believe I'll be fine from here. The problem is solved.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...