Is there a way to recreate The Jukebox Actionbar?

Discussion in 'Spigot Plugin Development' started by LikeWhat, Sep 23, 2016.

  1. Hello Spigot Community,

    I'm currently creating a Plugin wich involves the Actionbar...
    And i was wondering is there a way to recreate the Actionbar when you put a disc into a jukebox?

    Like this:
    [​IMG]
     
    #1 LikeWhat, Sep 23, 2016
    Last edited: Sep 23, 2016
  2. Do you mean the colour and such? Not without a mod (since action bar colours are limited to 16 colours). At most, you can send them in various colours to approximate the effect.
     
    • Agree Agree x 1
  3. Hmm... Okay but still thank you =)
     
  4. Actionbar?
     
  5. The text above the Inventory is the Actionbar =D
     
  6. Oh woops. Might have misread the OP. Probably because my Whiskey laying next to me :D

    Sorry for the disturbance.
     
  7. Wait what?
     
  8. could u fix the image? also do u mean change the text? or?
     
  9. Yes that is what I'm trying to do...

    I also tried the idea with cycling the colors... But it suddenly stops somewhere and continues after like 4 seconds:

    Code (Java):

    List<String> colorlist = Arrays.asList("1","2","3","4","5","6","7","8","9","a","b","c","d","e");
    runner2 = Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable() {
                                        public void run() {
                                            if(colorlist.size() > u) {
                                                for(Player all : Bukkit.getOnlinePlayers()) {
                                                    sendActionBarMessage(all, "ยง" + colorlist.get(u) + toRCString(getConfig().getStringList("messages").get(i).replace("{player}", all.getName()).replace("&h", "")), 10, plugin);
                                                }
                                                u++;
                                            }else{
                                                u = 0;
                                            }
                                        }
                                    }, 10, 10);
     
     
    #9 LikeWhat, Sep 23, 2016
    Last edited: Sep 23, 2016
    • Funny Funny x 1
  10. I believe there is a way to send music to players, could you not just cancel the interaction with jukeboxes and then play the music and add your own text?
     
  11. Another *possible* way is to modify disc names with resource packs, as well.
     
  12. This effect is not possible to create, because in source code of minecraft client it is defined. I think it is class GuiInGame.java if you have source code of minecraft client. So you can only simulate it by fast changing colors of your text.
     
  13. I think it is possible with sending packets. Because if a player activates a disc the other players also get this messages, right? If yes, than you could just send a packet to the player to start the music and the bar should appear.
     
  14. Loop through the ChatColor#values?
     
  15. Well i found out how to play the Effect but it only Plays the Text from the Disc again =|