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

How to add CustomName on CustomInventory ?

Discussion in 'Facepalm' started by Enes5519, Aug 5, 2017.

  1. Enes5519

    Enes5519 Spider Jockey

    Messages:
    28
    GitHub:
    Enes5519
    How to add CustomName on CustomInventory ?
     
  2. Marabou

    Marabou Baby Zombie

    Messages:
    137
    GitHub:
    wiligangster
    $inv->setCustomName ("...");
     
  3. Derpific

    Derpific Spider Jockey

    Messages:
    44
    GitHub:
    Derpific
    I'm pretty sure you are supposed to set the name on spawning.. Like with String Tags
     
  4. Marabou

    Marabou Baby Zombie

    Messages:
    137
    GitHub:
    wiligangster
    Not need you have several method.
     
    Last edited: Aug 5, 2017
  5. Marabou

    Marabou Baby Zombie

    Messages:
    137
    GitHub:
    wiligangster
    You can use too the StringTag
    PHP:
    $tag = new CompoundTag("", []);
    $tag->display = new CompoundTag("display", ["Name" => new StringTag("Name""name....")]);
    //Method with StringTag
     
  6. Enes5519

    Enes5519 Spider Jockey

    Messages:
    28
    GitHub:
    Enes5519
    I did it without the nbt
     
  7. Marabou

    Marabou Baby Zombie

    Messages:
    137
    GitHub:
    wiligangster
    Yes, you can check my example in up
     
  8. Enes5519

    Enes5519 Spider Jockey

    Messages:
    28
    GitHub:
    Enes5519
    My friend how I will use it in inventory.
     
  9. Marabou

    Marabou Baby Zombie

    Messages:
    137
    GitHub:
    wiligangster
    PHP:
    $tile Tile::createTile(blahhblahh);

    $inv $tile->getInventory();

    $inv->setCustomName("CustomInvMessage");

    //If you have already create the Tile.
    //Check the World if is loaded.
    if($this->getServer()->isLevelLoaded("worldname")){
        
    $this->getServer()->loadLevel("worldname");
    }
    $tile $this->getServer()->getLevelByName("worldname")->getTile(new Vector3($pos));//$pos define as $x, $y, $z

    $inv $tile->getInventory();
    $inv->setCustomName("CustomInvMessage");
     
    Last edited: Aug 5, 2017
  10. Enes5519

    Enes5519 Spider Jockey

    Messages:
    28
    GitHub:
    Enes5519
    I do not use tile. I use a fake inventory holder
     
  11. Marabou

    Marabou Baby Zombie

    Messages:
    137
    GitHub:
    wiligangster
    if($tile instanceof YourCustomInventory){
    //Blahhblahh ...
     
  12. Enes5519

    Enes5519 Spider Jockey

    Messages:
    28
    GitHub:
    Enes5519
    I will try this
     
  13. Enes5519

    Enes5519 Spider Jockey

    Messages:
    28
    GitHub:
    Enes5519
    Not work.
     
  14. DanielYTK

    DanielYTK Zombie

    Messages:
    227
    $tile->setName("bla,bla,bla");
     
  15. Enes5519

    Enes5519 Spider Jockey

    Messages:
    28
    GitHub:
    Enes5519
    PUFF. NO USE TILE
     
  16. Marabou

    Marabou Baby Zombie

    Messages:
    137
    GitHub:
    wiligangster
    Please can you put your code here ?
    for more information and solve your problem.
     
  17. Enes5519

    Enes5519 Spider Jockey

    Messages:
    28
    GitHub:
    Enes5519
    Never mind. I've already delete the code. I made fake tile with chest tile.
     
  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.