How can I render text on the screen?

Discussion in 'Plugin Development' started by LRRoberts0122, Dec 19, 2014.

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

    LRRoberts0122

    I'd like to develop a plugin for an RPG server that will allow a user to see how much "gold" and "silver" they have as part of their UI. I have a font sheet that has a gold coin icon. Ideally, in the bottom right corner of the screen, I'm just trying to render out, for example:

    Money: 198[gold] 12[iron]

    Code:
    var gold = 198;
    var silver = 12;
    
    var money_string = "Money: " + gold + gold_icon + "   " + silver + silver_icon;
    
    I don't want to mod the client, I'd just like a server plugin that will render the simple text. I know Java must have this as some kind of native feature... I'm just not sure how to go about doing it.

    Thanks!
     
  2. Offline

    bennie3211

    Not possible with bukkit or you need to use spout for that.
     
  3. @LRRoberts0122 There are limits to what you can do without client mods. The only text rendering you can do is in chat, as a hologram, a scoreboard, or a boss bar. None of these will allow you to show the gold/iron ingots, though.
     
  4. Offline

    LRRoberts0122

    The Gold / Iron ingots are special characters, using font-sheets, that can be placed in the chat, on a sign, and in the GUI, so I'm assuming it can be placed there, as well. But I think we'll just use a boss bar.

    Does anyone know if I use the Boss Bar, and if someone fights an EnderDragon, if the boss bar is still active?

    Will the health change for everyone on the server? What happens if the boss is killed? Will the boss name replace the text on the screen?
     
  5. Offline

    mythbusterma

    @LRRoberts0122

    Which special character, exactly, is "Iron bar?" I don't see "Iron bar" on here. How do you go about putting those on a sign as well?

    What do you mean "use the boss bar?" Please elaborate.
     
    Last edited: Dec 19, 2014
  6. Offline

    stenlankreijer

    Regablith likes this.
  7. Offline

    PreFiXAUT

    @stenlankreijer Well, it's using Features from MC 1.8, and that Text will disapear after a period of Time. I know you can kinda deactivate it, but what would it help if you'ld have a giant Font in the middle of your screen telling you how much money you got, when you can't even play the Game then.


    @LRRoberts0122 Your Idea with the custom Coins is a nice Idea, but nothing more. Minecraft has a own Font-File, and it's very limited. To be able to use your Coins, you'ld need to replace a character for it (For example the Sphax-Resourcepack does it -> ß becomes to an male-sign, but the ß is an often used character in german so it's tricky). The next thing is, to force people to download a certain Resourcepack. I think it wasn't possible with Bukkit only, I guess you need to use Spigot for that.

    I think a simple Scoreboard would be enought. But if you still wanna have it fancy, you COULD try to create a dynamic Map with all Information/Images.
     
  8. Offline

    Webbeh

    I personally have a gold ingot item that players have on their inventory at all time. When they scroll over it, the name of the item is changed to "Points: ..." or whatever. You could use something like that.

    You can also use the new ChatPosition that positions text over the action bar, but neither craftbukkit nor spigot have an API yet, so you have to use spigot's API, or NMS code if you use craftbukkit.
     
Thread Status:
Not open for further replies.

Share This Page