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

Block ID out of bounds

Discussion in 'Development' started by Error202, May 27, 2019.

  1. Error202

    Error202 Spider Jockey

    Messages:
    39
    I need place block with ID = 380 (Item::CAULDRON)
    I got error, when I use $level->setblock(...):
    Code:
    InvalidArgumentException: "Block ID 380 is out of bounds" (EXCEPTION) in "src/pocketmine/block/BlockFactory" at line 386
    
    Why?
     
  2. wolfdale

    wolfdale Zombie Pigman

    Messages:
    535
    GitHub:
    diamond-gold
    Muqsit likes this.
  3. Error202

    Error202 Spider Jockey

    Messages:
    39
    If I need add custom block class and register him, how I can use dynamic ids?
    BlockFactory::registerBlock(new CustomBlock(ID));
     
  4. wolfdale

    wolfdale Zombie Pigman

    Messages:
    535
    GitHub:
    diamond-gold
    That depends on your CustomBlock class's constuctor
     
  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.