Change slot

Discussion in 'Plugin Requests' started by daniel363, Mar 14, 2017.

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

    daniel363

    Plugin category: Misc

    Minecraft version: 1.8

    Suggested name: SlotChanger

    What I want:
    A command to change the slot of the argumented player using this code, that I found on the internet.
    Code:
    event.getPlayer().getInventory().setHeldItemSlot(4);
    It will force the argument player to change their slot to the slot argument.
    Source

    I would want it made since I have no idea about Java as a whole. I would learn, but I am more a skript person and you cannot change slots on that.

    Ideas for commands:
    -
    /slot <online player> <slot (0-8 or if you convert it, 1-9)> (click? true/false)*

    Ideas for permissions:
    -
    changeslot.*

    When I'd like it by: Anytime. Maybe it's hard or easy, I have no idea :c

    * This is tricky, see in comments.
     
    Last edited: Mar 16, 2017
  2. Offline

    timtower Administrator Administrator Moderator

    @daniel363 We can't force open books.
    If anybody wants to prove me wrong: show code please.
     
  3. Offline

    daniel363

    It isn't code, however it is a video proving it. @timtower
     
  4. Offline

    timtower Administrator Administrator Moderator

    @daniel363 Still want to know the code behind it, because as far as I can tell this is some heavy NMS stuff.
     
    legostarwarszach likes this.
  5. Offline

    daniel363

    @timtower Maybe they opened a book GUI? I don't know if that is possible, but maybe they want to create a illusion.
     
  6. Offline

    timtower Administrator Administrator Moderator

    @daniel363 That is the thing: the server can't tell the client to open something without doing some very tricky stuff. And I don't believe that every GUI is supported.
    I did find out that it is signed books only that can do this.
     
  7. Offline

    daniel363

    @timtower Well that makes sense since the book is signed. If it isn't possible to do the click thing unless you do tricky (and laggy?) stuff, I would just want to a command to change the players slot then. Will edit in my main post, hopefully, someone will take interest :c
     
  8. Offline

    timtower Administrator Administrator Moderator

    @daniel363 You showed that it was possible to open booms. Just keep it inthe request if that is what you want.
    Tricky does not mean laggy, not for this at least.
    And that I don't know how does not mean that nobody knows it.
     
  9. Offline

    Firestar311

    I have been looking into this. This is very heavy NMS, which not a lot of Bukkit/Spigot developers know NMS code.
    And if you wanted to change minecraft version, then the plugin would have to be updated before that.

    Possibly, not super laggy, but hard for most developers that I have come across
     
  10. Offline

    daniel363

    Sorry if I sound like a nagger but thanks anyway. I edited the post back but added a disclaimer that using the click thing is tricky and is not needed. Hopefully someone will make hopefully a simple plugin to change a players slot.
     
  11. Offline

    maved145

    daniel363 likes this.
  12. Offline

    daniel363

    Thanks! Can you change it so console can execute the command? I don't know if that is possible.
     
  13. Offline

    maved145

    daniel363 likes this.
  14. Offline

    daniel363

Thread Status:
Not open for further replies.

Share This Page