Enchantments

Discussion in 'Plugin Development' started by DoggyCode™, Feb 19, 2016.

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

    DoggyCode™

    How could I possibly display a Item's enchantment(s) in a user-friendly form in chat?

    Ex:
    --
    Protection: 4
    Durability: 3
    --
     
  2. Offline

    Gerov

    @DoggyCode™ It depends, will it be displayed to everyone? Or just a specific player?
     
  3. Offline

    teej107

    @DoggyCode™ Get the enchantment and its levels? Integers don't display in Roman numerals to begin with.
     
  4. Offline

    DoggyCode™

    getEnchantments returns a map. Should I just loop though this map and spit out the key+value?
     
  5. Offline

    HoeMC


    Yes
     
  6. Offline

    mine-care

    @DoggyCode™ Yep, loop through the entries of the map where key is the Enchantment and value is the level.
    Then you can format it somehow even using block characters to form some kind of "box".
     
  7. Offline

    DoggyCode™

    Block characters? Block?
     
  8. Offline

    mine-care

    DoggyCode™ likes this.
  9. Offline

    boomboompower

    Whoa I just found out there is something called texture packs...
     
  10. Offline

    DoggyCode™

    What?
     
  11. Offline

    boomboompower

    @DoggyCode™
    You can use texture packs to do this .-.

    In the lang file put
    Code:
    enchantment.level.1=1
    enchantment.level.2=2
    enchantment.level.3=3
    enchantment.level.4=4
    enchantment.level.5=5
    enchantment.level.6=6
    enchantment.level.7=7
    enchantment.level.8=8
    enchantment.level.9=9
    enchantment.level.10=10
    And so on.
     
  12. Offline

    I Al Istannen

    @DoggyCode™
    For the levels:
    You can just simply convert it to a roman Number. Just google for "how to convert number to roman" or similar.
     
  13. Offline

    DoggyCode™

    Absolutely not what I ment.
     
Thread Status:
Not open for further replies.

Share This Page