Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Invisible Skull

Comments in 'Plugin Development' started by Irish, May 15, 2016.

  1. Irish
    Offline

    Irish Active Member

    Joined:
    Apr 24, 2016
    Posts:
    96
    Minecraft User:
    _Irish_
    The skull block is still invisible, even after creating the tile.
    PHP:
    public function onDeath(Death $event){
            
    $player $event->getEntity();

            if(
    $player instanceof Player){
                
    $head Block::get(Block::SKULL_BLOCK);
                
    $x $player->x;
                
    $y $player->y;
                
    $z $player->z;
                
    $nbt = new CompoundTag("", [
                    new 
    ListTag("Items", []),
                    new 
    StringTag("id"Tile::SKULL),
                    new 
    IntTag("x"$x),
                    new 
    IntTag("y"$y+1),
                    new 
    IntTag("z"$z)
                ]);
                
    $nbt->Items->setTagType(NBT::TAG_Compound);
                
    Level::
                
    $tile Tile::createTile("Skull"$player->getLevel()->getChunk($x >> 4$z >> 4), $nbt);
                
    $level $player->getLevel();
                
    $level->setBlock(new Vector3($x$y+1$z), $head);
                 }
  2. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    What's the point of creating a tile but not using it?

    PHP:
    $level->addTile($tile);
    jojoe77777 likes this.
  3. jojoe77777
    Offline

    jojoe77777 Notable Member Plugin Developer

    Joined:
    May 28, 2015
    Posts:
    653
    Plugins:
    1
    Minecraft User:
    jojoe77777
    PHP:
    $nbt->Items->setTagType(NBT::TAG_Compound);
    Level::
    $tile Tile::createTile("Skull"$player->getLevel()->getChunk($x >> 4$z >> 4), $nbt);
    Remove Level:: and do what @Legoboy0215 said.
    Legoboy0215 likes this.
  4. Irish
    Offline

    Irish Active Member

    Joined:
    Apr 24, 2016
    Posts:
    96
    Minecraft User:
    _Irish_
    Tried this, got an error message about $Rot :/
    Main:
    PHP:
    $x $player->x;
                
    $y $player->y;
                
    $z $player->z;
                
    $nbt = new CompoundTag("", [
                    new 
    ListTag("Items", []),
                    new 
    StringTag("id"Tile::SKULL),
                    new 
    IntTag("x"$x),
                    new 
    IntTag("y"$y+1),
                    new 
    IntTag("z"$z)
                ]);
                
    $nbt->Items->setTagType(NBT::TAG_Compound);
                
    $tile Tile::createTile("Skull"$player->getLevel()->getChunk($x >> 4$z >> 4), $nbt);
                
    $level $player->getLevel();
                
    $level->addTile($tile);
                
    $level->setBlock(new Vector3($x$y$z), $block);
                
    $level->setBlock(new Vector3($x$y+1$z), $head);
  5. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215

Share This Page

Advertisement