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

How do I link custom items with textures

Discussion in 'Help' started by esh123cookie, Apr 24, 2020.

  1. esh123cookie

    esh123cookie Baby Zombie

    Messages:
    104
    GitHub:
    esh123cookie
    $id = 500;
    $meta = 1;
    $name = ("test");
    ItemFactory::registerItem(new Item($id,1,$name), true);
    $this->getServer()->getPluginManager()->registerEvents($this, $this);
    Item::addCreativeItem(Item::get($id,$meta));

    /\/\/\/\
    That's the code.
    This is the error
    \/\/\/\/

    [04:16:05] [Server thread/CRITICAL]: RuntimeException: "Trying to overwrite an already registered item" (EXCEPTION) in "src/pocketmine/item/ItemFactory" at line 298

    How do I fix this as I already have a custom id set for $item?
    How would I prevent it from overwriting?
     
  2. esh123cookie

    esh123cookie Baby Zombie

    Messages:
    104
    GitHub:
    esh123cookie
    Well, I got an update it registered as a new item but is still the same png as a stick. So next I need to figure out how unlink them
     
  3. NTT

    NTT Zombie

    Messages:
    311
    GitHub:
    NTT1906
    U can't add custom image on a custom item
     
  4. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    I think adding the item using a resource pack would work
     
  5. esh123cookie

    esh123cookie Baby Zombie

    Messages:
    104
    GitHub:
    esh123cookie
    Well its just the png which didn't work, the item in creative is {id} {1}<- Meta
    So I think you might right I need add to a resource pack properly
     
  6. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    I read in another thread, that it's possible to add a custom item if you add it with a resource/baheviour back. Maybe try searching online on how to add items with a behaviour pack.
     
  7. esh123cookie

    esh123cookie Baby Zombie

    Messages:
    104
    GitHub:
    esh123cookie
    Okay I'll try that and then update you on if it works or not
     
  8. esh123cookie

    esh123cookie Baby Zombie

    Messages:
    104
    GitHub:
    esh123cookie
    IKIK its change the id so it's not for something in mc, so you create your own self::Item which means it wont overwrite anything and the png with stick to that item just a random id and meta
     
  9. NTT

    NTT Zombie

    Messages:
    311
    GitHub:
    NTT1906
    U just can't, the add-on doesn't work like that
     
  10. NTT

    NTT Zombie

    Messages:
    311
    GitHub:
    NTT1906
    If
    Yeah, if u can implement behavior pack
     
  11. NTT

    NTT Zombie

    Messages:
    311
    GitHub:
    NTT1906
    It is only possible if u are using BDS
     
  12. NTT

    NTT Zombie

    Messages:
    311
    GitHub:
    NTT1906
  13. esh123cookie

    esh123cookie Baby Zombie

    Messages:
    104
    GitHub:
    esh123cookie
    Well, I've created a custom item not just different id, but by using a completely different name. Which means it's registered as a pocket mine item with no png right now
     
  14. NTT

    NTT Zombie

    Messages:
    311
    GitHub:
    NTT1906
    I don't wanna make u sad but item name is not important, the important thing is the id, meta,...
     
  15. NTT

    NTT Zombie

    Messages:
    311
    GitHub:
    NTT1906
    U should have a look at PocketAI
     
  16. esh123cookie

    esh123cookie Baby Zombie

    Messages:
    104
    GitHub:
    esh123cookie
    Yeah lol I have that set too

    esh123unicorn[/99.234.215.233:36759] logged in with entity id 1 at (db, 256, 66, 256)

    [16:35:55] [Server thread/INFO]: esh123unicorn[/99.234.215.233:36759] logged out due to timeout

    that's the issue now it crashes my game
     
  17. Michael Victor

    Michael Victor Creeper

    Messages:
    3
    How very interesting. I'm working on this exact same problem. I can create a custom item and have my resource pack, yet I cannot find a way to link the PNG to the new item :/
     
  18. NTT

    NTT Zombie

    Messages:
    311
    GitHub:
    NTT1906
    I told u bruh, but u can do it if you know how to install Behavior pack, just wait until pmmp implements it
     
  19. esh123cookie

    esh123cookie Baby Zombie

    Messages:
    104
    GitHub:
    esh123cookie
    Ah lol you cannot cause it gets overwritten
     
  20. esh123cookie

    esh123cookie Baby Zombie

    Messages:
    104
    GitHub:
    esh123cookie
    I figure out how to make a behaviour
     
  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.