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

Solved Register custom item

Discussion in 'Development' started by Herojhjh, Jan 11, 2018.

  1. Herojhjh

    Herojhjh Silverfish

    Messages:
    20
    GitHub:
    herojhjh
    How to register custom item in pocketmine? i mean register non-minecraft item, is it possible?
     
  2. Palente

    Palente Slime

    Messages:
    75
    GitHub:
    palente
    I think with that im not sure that work i tried it you can give but don't see the item(You need a texture for that item)
    https://github.com/pmmp/PocketMine-MP/blob/master/src/pocketmine/item/Item.php#L196-L214
    https://github.com/pmmp/PocketMine-MP/blob/master/src/pocketmine/item/ItemFactory.php#L260-L282
    PHP:
    #The id of the item to create 
    $id 700;
    $name "New Item Name";
    #If you want to override a item set to true
    #Do it on the OnEnable() or where you want
    ItemFactory::registerItem(new Item($id,0,$name), false);
    #To see that item in the inventory creative
    Item::addCreativeItem(Item::get($id));
     
    Last edited: Jan 11, 2018
  3. xXNiceAssassinlo YT

    xXNiceAssassinlo YT Zombie Pigman

    Messages:
    499
    GitHub:
    xXNiceYT
  4. Mystral77

    Mystral77 Creeper

    Messages:
    4
    Hello
    Where can I found a tuto to create a texture pack (mcpack) for a new item ?
     
  5. xXNiceAssassinlo YT

    xXNiceAssassinlo YT Zombie Pigman

    Messages:
    499
    GitHub:
    xXNiceYT
    Watch on yt
     
  6. Mystral77

    Mystral77 Creeper

    Messages:
    4
    Ok, I thank you... I see a Phar using textures "turrets" I will see how they made it ...
    What is "yt" ???
     
    xXNiceAssassinlo YT likes this.
  7. EdwardHamHam

    EdwardHamHam Skeleton

    Messages:
    962
    GitHub:
    edwardhamham
    It means YouTube
     
    jasonwynn10 likes this.
  8. xXNiceAssassinlo YT

    xXNiceAssassinlo YT Zombie Pigman

    Messages:
    499
    GitHub:
    xXNiceYT
    yt = youtube
     
  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.