[Essentials] How to add an underscore in item name?

Discussion in 'Spigot Plugin Help' started by lecraeman, Feb 1, 2016.

Thread Status:
Not open for further replies.
  1. So, I am using this command for a statistics thing, but I realized the underscores just convert to spaces.

    /give Lecraeman diamondpickaxe 1 name:&cThis_Is_A_Test_&8[&e&l%statistic_mine_block%&8]

    How can I add an ACTUAL underscore to the item name??
     
  2. I'm not really sure, Surely essentials will add in a character that cancels the _ to cause a space
     
  3. mathhulk

    mathhulk Retired Moderator
    Retired

    I don't think it is possible... :(
     
  4. Looking at the essentials source code, it seems that there isn't anything in place to allow underscores. They just simply have
    Code (Text):
    String itemName = stack.getType().toString().toLowerCase(Locale.ENGLISH).replace('_', ' ');
    If you aren't limited to just essentials though, you could experiment with "/minecraft:give" - granted it's certainly not as easy, but there are tools online that allow you to customise it easier, such as this site here: https://www.minecraftjson.com/
     
  5. mathhulk

    mathhulk Retired Moderator
    Retired

    I guess you could replace _ with .space. or something, which would then allow _ to be used regularly.
     
  6. Every underscore you write will be a space. So I guess it's not possible.
     
  7. mathhulk

    mathhulk Retired Moderator
    Retired

    Underscore* ;)
     
  8. yea, I also though something was wrong :p
     
Thread Status:
Not open for further replies.