Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

i need change item name code

Comments in 'Plugin Development' started by JUZEXMOD, Oct 11, 2016.

  1. JUZEXMOD
    Offline

    JUZEXMOD New Member

    Joined:
    May 28, 2016
    Posts:
    19
    Minecraft User:
    JUZEXMOD
    Hi

    i need change item name code
    example:

    Diaomnd Sword -> Hi Sword
  2. ImagicalGamer
    Offline

    ImagicalGamer Active Member

    Joined:
    Feb 25, 2016
    Posts:
    141
    Minecraft User:
    ImagicalGamer
    To change an items name you can use:
    PHP:
    Item::setCustomName();
  3. JUZEXMOD
    Offline

    JUZEXMOD New Member

    Joined:
    May 28, 2016
    Posts:
    19
    Minecraft User:
    JUZEXMOD
    I do not understand code :(
  4. corytortoise
    Offline

    corytortoise New Member

    Joined:
    Aug 23, 2015
    Posts:
    10
    Minecraft User:
    corytortoise
    Then why are you asking for it? First of all, don't even think about plugin development until you learn at least the basics of PHP and plugin development. Second of all, I am pretty sure that this thread follows none of the guidelines. You didn't provide anything except a very short description of what you wanted.
    EdwardAllington likes this.
  5. xBeastMode
    Offline

    xBeastMode Active Member

    Joined:
    Nov 27, 2015
    Posts:
    292
    We are like code, we do what you tell us to do, not what you want us to do. We do our best to understand and if there is a mistake we give you [a] comeback/response/feedback.
    EdwardAllington likes this.
  6. MichaelM04
    Offline

    MichaelM04 Active Member Plugin Developer

    Joined:
    Nov 12, 2015
    Posts:
    213
    Plugins:
    1
    Minecraft User:
    Michael
    This thread was created under "Plugin Development" not "Plugin Request" if you need a plugin made that will do so please correct the thread type, if you do want to create a plugin, code was provided, unless you do not understand the code I'll explain further. If you want to set name on let's say, PlayerItemHeldEvent

    PHP:
    public function onHeld(PlayerItemHeldEvent $event){
        
    $player $event->getPlayer();
        
    $item $event->getItem();
        
    $item->setCustomName("Name");
        
    $player->setItemInHand($item);
    }
    Last edited: Oct 11, 2016
  7. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    Typo: getPlayer(), not get player() :)
    MichaelM04 likes this.
  8. MichaelM04
    Offline

    MichaelM04 Active Member Plugin Developer

    Joined:
    Nov 12, 2015
    Posts:
    213
    Plugins:
    1
    Minecraft User:
    Michael
    xD auto correct.
    ImagicalGamer likes this.

Share This Page

Advertisement