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

How to register items to the the item list?

Discussion in 'Development' started by xBeastMode, Mar 28, 2017.

  1. xBeastMode

    xBeastMode Shog Chips

    Messages:
    0
    If I want to register items that aren't registered in PocketMine, how do I register them via plugin? Is it recommended? I want to register a map but I keep getting an empty object when constructing it. Is there a certain way that PocketMine registers items?
     
  2. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    PHP:
    Item::$list[itemid] = ClassExtendingItem::class
    It never worked for me, but I don't see why it shouldn't be working.
     
  3. xBeastMode

    xBeastMode Shog Chips

    Messages:
    0
    The problem is that I get an empty object with Item::get() even though I registered the item. If the item isn't registered I can still get the item with "/give" but with the same problem. Do I need to change anything in the item list?
     
  4. dktapps

    dktapps Administrator Staff Member PMMP Team

    Messages:
    774
    GitHub:
    dktapps
    This cannot be done with the current master branch. However, there is WIP API on the api3/blocks branch to allow you to register your own blocks and items. Note that there's a lot of mess on that branch currently, so some stuff might not work.
     
  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.