1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Custom Name for an item

Discussion in 'Development' started by iCirgio, Jul 18, 2018.

  1. iCirgio

    iCirgio Slime

    Messages:
    92
    GitHub:
    lolnova
    Code
    PHP:
    class powergem extends Item {

           public function 
    __construct($meta 0){
                      
    parent::__construct(467$meta"Power Gem");
        }
           public function 
    getCustomName() : String {
                   return 
    "Power Gem";
        }

           public function 
    getVanillaName() : String {
                   return 
    "Power Gem";
        }

           public function 
    getMaxStackSize() : int {
                   return 
    16;
        }
     }
    Everything works when I do /give (name) 467. It shows it gives me Power Gem but when I put item in my hand it still shows Heart Of The Sea.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.