Genisys icon indicating copy to clipboard operation
Genisys copied to clipboard

Heads don't spawn properly in plugins

Open buchwasa opened this issue 7 years ago • 4 comments

Issue description

When you use a plugin that spawns a head, it pretty much messes up on placing the head, as you can see between the two pictures below, there is the difference between PE and PC head spawning. EDIT: It does affect all heads, not custom heads.

Steps to reproduce the issue

Try using the following code: ` public function onDeath(PlayerDeathEvent $event){ $player = $event-getPlayer(); $level = $player->getLevel(); $x = $player->getFloorX(); $y = $player->getFloorY(); $z = $player->getFloorZ(); $pos = $player->getPosition(); $level->setBlock($pos->add(0, 1, 0), Block::get(Block::SKULL_BLOCK), true, true); $level->setBlock($pos, Block::get(Block::NETHER_BRICK_FENCE)); $chunk = $level->getChunk($x >> 4, $z >> 4); $nbt = new CompoundTag("", [ new StringTag("id", Tile::SKULL), new IntTag("x", $x), new IntTag("y", $y+1), new IntTag("z", $z), new ByteTag("SkullType", SkullBlock::STEVE_HEAD), new ByteTag("Rot", floor(($player->yaw * 16) + 0.5)) ]); Tile::createTile("Skull", $chunk, $nbt); $t = $level->getTile(new Vector3($x, $y+1, $z)); $level->addTile($t);

}`

OS and versions

  • Genisys: c4407304
  • PHP: 7.0.10
  • Server OS: Windows 10
  • Game version: 0.15.10

Crashdump, backtrace, memory dumps, plugins list or other files

http://imgur.com/a/2de8m Sorry bad quality: http://imgur.com/a/0cfXl

buchwasa avatar Oct 15 '16 22:10 buchwasa

That's a MCPE bug, default heads work with fences. But as custom skin heads aren't actually in MCPE, it glitches out as an entity

dancing-ipsum avatar Oct 15 '16 22:10 dancing-ipsum

That is a default head, but skinned as a custom one via texture packs. So no it doesn't glitch as an entity, but placing it via code is weird. I've had this issue happen as well.

sylvrs avatar Oct 17 '16 04:10 sylvrs

Does this issue still occur and does it occur on other blocks as well?

JackNoordhuis avatar Dec 16 '16 07:12 JackNoordhuis

Yes it still occurs, it occurs with only this tile. The skull spawns in the middle of the block instead of the bottom if spawned by plugin.

sylvrs avatar Dec 16 '16 13:12 sylvrs