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

[Solved]Create Tile

Discussion in 'Development' started by Kyd, Mar 22, 2017.

  1. Kyd

    Kyd Zombie Pigman

    Messages:
    678
    GitHub:
    boi1216
    Why I can not create tile i get error
    PHP:
    public function market(Player $o){
        
    $o->getLevel()->setBlock(new Vector3($o->getFloorX(), $o->getFloorY() - 4$o->getFloorZ()), Block::get(Block::CHEST));
        
    $nbt = new CompoundTag("", [
            new 
    ListTag("Items", []),
            new 
    StringTag("id"Tile::CHEST),
            new 
    IntTag("x"$o->getFloorX()),
            new 
    IntTag("y"$o->getFloorY() - 4),
            new 
    IntTag("z"$o->getFloorZ()),
            new 
    StringTag("CustomName""Market")
        ]);
        
    $nbt->Items->setTagType(NBT::TAG_Compound);
        
    $tile Tile::createTile("Chest"$o->getLevel(), $nbt$o);
        if(
    $tile instanceof Chest) {
            
    $config = new Config($this->getDataFolder() . "market.yml"Config::YAML);
            
    $market $config->get("Market");
            
    $tile->setName("Market");
            
    $tile->getInventory()->clearAll();
            for (
    $i 0$i count($market); $i+=2) {
                
    $slot $i 2;
                
    $tile->getInventory()->setItem($slotItem::get($market[$i], 01));
            }
            
    $tile->getInventory()->setItem($tile->getInventory()->getSize()-1Item::get(Item::WOOL141));
            
    $o->addWindow($tile->getInventory());
        }
    }
    Error:
    Wait second:D
     
    Last edited: Mar 22, 2017
  2. Kyd

    Kyd Zombie Pigman

    Messages:
    678
    GitHub:
    boi1216
    Ah, I do not saved file ._. Sorryyyy
     
  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.