JoinHotbarSelect

Discussion in 'Plugin Requests' started by Jaspenton, Dec 18, 2016.

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

    Jaspenton

    When a player joins their selected hotbar slot gets changed according to slot number in config.
     
  2. Offline

    Skrubzy

    I doubt this is possible
     
  3. Offline

    Ruptur

  4. Offline

    Skrubzy

    Well maybe if you force them to execute the number specified, I didn't really think of that.
     
  5. Offline

    Ruptur

    @Skrubzy

    You can do it using.
    Code:java
    1. player.getInventory().setHeldItemSlot(index);

    This works for 1.8.x and 1.7. Im not sure about versions 1.9 & 1.10
     
  6. Offline

    Skrubzy

    I'm dumb.
    EDIT: I just tested it with Spigot 1.9.4 and it worked, but it didn't create a file to change the hotbar number in
     
  7. Offline

    Jaspenton

    Can u please create a basic plugin to do this
     
  8. Offline

    Ruptur

  9. Offline

    Jaspenton

    Thanks SOOO much (can I upload it to bukkit so that other people cam find and use it)
     
  10. Online

    timtower Administrator Administrator Moderator

    Never upload something that you didn't make and can't maintain.
     
    MrGeneralQ and UnseenMC like this.
  11. Offline

    Jaspenton

    Ok sorry, can u also make it when they join a world (set in config) that would also be very useful

    Plz someone...

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Dec 19, 2016
  12. Offline

    MrGeneralQ

    So worldname in config with slot? For ex:

    The held item slot will be set if The worldname is in there? If I may ask.. How is this helping you?
     
  13. Offline

    Jaspenton

    Yes would name in slot, and a command (/jhs [playername][slot](world)

    I need this because when the player right clicks using the iron door to leave a game, the get tped to the lobby 4 minigames. And in mini games in the samee slot and the iron door there is a bed to go back to hub. So when the right clock on a join sign witwithout changing slot the get telepotelepoted to hub and it would just make it easier the they didn't need to change the slot.
    Yeah.... that's y
     
  14. Offline

    Skrubzy

    Could you also make their first hotbar position separate from logins after their first join?
    And could you also change "0 - 8" to "1 - 9" please?
    So the config would look something like this:
    Code:
    # \----------------------------------------------/ #
    # |      JoinHotbarSelect Configuration File     | #
    # |              Plugin by Abstrct               | #
    # |                   1 - 9                      | #
    # /----------------------------------------------\ #
    
    FirstJoinSlot: 1
    World: World
        joinItemSlot: 5
    World: Test_World
        joinItemSlot: 9
    When they first join the server, their hotbar will be on slot 1
    When they enter the world "World" their slot will be on 5
    When they enter the world "Test_World" their slot will be on 9
     
  15. Offline

    Jaspenton

    ^^ Yes that would be brilliant ^^
     
  16. Offline

    Skrubzy

    And could you also make an alias for this command like "/hotbar" and "/hotbarslot" or something
     
  17. Offline

    MrGeneralQ

    Could you explain that part a little bit more?
     
  18. Offline

    Skrubzy

    I was adding onto his request for a new command
     
  19. Offline

    MrGeneralQ

    Explain in detail what The command should do pls.
     
  20. Offline

    Jaspenton

    Change the chosen player selected hotbar slot.

    /jhs reload #reload config
    /jhs set [playername] [slotnumber]
    /jhs join [slotnumber] {world} # set the join selected hotbar on world join, if no world joints on server join
     
  21. Offline

    Skrubzy

    I'm not quite sure which one he wanted it to do, but my guess is one of these:

    It'll switch their hotbar slot for that one time (Not permanent)
    So if I'm on slot #2 and someone types "/hotbar Skrubzy 5" my hotbar will switch to the fifth slot. But if I relog, my slot will change to whatever is set in the config

    Or he could of meant like this (Per-player slots)
    "/hotbar Skrubzy 5 world" will make my hotbar switch to slot 5 everytime I join the world "World"
    Not specifying a world would make my slot switch to the defined number-slot no matter which world I login on

    And maybe "/hotbar Skrubzy" would send you a message with what their hotbar slot is set to:
    "Skrubzy's hotbar slot is set to 5"

    -------------------------------------------------------------------------------------------------------------------------
    How about permission you could give to players to set their individual hotbar slot? If they don't have any of the permissions, it'll be set to the default in config.yml
    Code:
    hotbarslot.1
    hotbarslot.2
    hotbarslot.3
    hotbarslot.4
    hotbarslot.5
    hotbarslot.6
    hotbarslot.7
    hotbarslot.8
    hotbarslot.9
    hotbarslot.none
    And you could set the slot to whatever it was on before they went offline with the permission "hotbarslot.none" or putting "NONE" in config instead of a number
    Code:
    joinItemSlot: NONE
     
    Last edited: Dec 20, 2016
  22. Offline

    MrGeneralQ

    One more Question. i still don't get The use of this Plugin. Why shouldn't The player just scroll to that slot.

    Eventually after joining The player can still change slot. So I don't get The use for this.
     
  23. Offline

    Skrubzy

    It could be used for hubs or something; say the compass (To choose your server) Is in slot number 5, having to scroll over to it every time you want to join a server could get annoying. With this plugin, you just have to right click (No scrolling)
     
  24. Offline

    Ruptur

    Im on it.
     
  25. Offline

    Skrubzy

    MrGeneralQ has already made it...
     
  26. Offline

    MrGeneralQ

    Yea ... Very Nice ..
     
  27. Offline

    Jaspenton

  28. Offline

    Ruptur

    If you've already started it then i wont bother
     
  29. Offline

    MrGeneralQ

    It's fine. If you can do this. This Plugin isn't that much of work
     
  30. Offline

    Ruptur

    @Jaspenton
    Download here.
    Need anything or if i missed something out, tahg me

    --------------------------------------
    Plugin info:
    Show Spoiler

    plugin.yml
    Code:
    commands:
      hotbarselect:
        aliases: [hotbar, jhs]
        description: HotbarSelect main command.
    
    permissions:
      hotbarselect.reload:
        description: Reload the config
        default: OP
    
      hotbarselect.help:
        description: View the help menu
        default: OP
    
      hotbarselect.join:
        description: Set the server or world join slot
        default: OP
    
      hotbarselect.set:
        description: Change a players slot index.
        default: OP
    config.yml
    Code:
    # \----------------------------------------------/ #
    # |        HotbarSelect Configuration File       | #
    # |               Plugin by Abstrct              | #
    # /----------------------------------------------\ #
    # Version 0.2.1
    # https://bukkit.org/threads/joinhotbarselect.439063/
    
    # slots 1 - 9
    global-slot: 5
    prefix: '&9&oHotbar &7\u00BB &f'
    
    world-join-slots:
      world_the_end: 1
      world: 9
    
    #restrict_slots: [2, 4]
     
Thread Status:
Not open for further replies.

Share This Page