Smooth block disguise movement

Discussion in 'Spigot Plugin Development' started by FreeWall, May 30, 2016.

  1. I can not figure out how Mineplex handle smooth block disguise movement in BlockHunt (Hide n Seek) minigame.
    I can disguise player to blocks with LibsDisguises, but it's never smooth. I also tried to create FallingBlock, but I don't know how to move them with player and be non-solid blocks.
    Any ideas? Thank's.
  2. I'm not sure what you mean by smooth? What I would assume they do is that after the player has stood still for enough time then other players stop receiving their packets (think along the lines of VanishNP) at the same time the server is stopping other players from seeing someone they're also sent a fake block packet.

    Hope that clears things up.
  3. I'll try to explain it (sorry for my bad english).

    I was trying to create smooth block movement (like through velocity). With use of LibsDisguises it's like teleporting from one to another position, which is not good looking (looks like FPS lags if you know what i mean).

    I was trying to achieve this by teleporting ArmorStand to player position, because when you teleport ArmorStand, it will teleport very "slowly" and it's movement looks like animal entity following player (very nice movement). So basically, ArmorStand should be enough to achieve this.
    The problem is, when you attach some another entity to ArmorStand (FallingBlock in this example), ArmorStand can not be teleported because of attached entity.

    So my another idea was to create ArmorStand and FallingBlock only through packets. I can create ArmorStand and FallingBlock and spawn it through packets for player, but I can not attach themselfs with PacketPlayOutAttachEntity (simply does nothing). So that's the biggest and only one problem for now.

    I was trying to contact some developers from Mineplex and TheHiveMC to ask them for advice, but still have no answer :-(.

    If someone has already achieved this, please, help me with some advice.
    #4 FreeWall, Jun 2, 2016
    Last edited: Jun 2, 2016
  4. Couldn't you just spawn a block entity for each "disguised" player, and then set it's velocity equal to the player's? Or does this not achieve the smooth effect that you're looking for?
  5. I also tried this. The problem with FallingBlocks (FallingSand) spawned by World#spawnFallingBlock() is that they are destroyed (died) when they touch the ground (they are trying to became solid (like sand), you can cancel this in some EntityChangeBlockEvent, but you can't cancel death of this block). Plus, changing the velocity of FallingBlock is very weird, it looks like it's constantly falling (so it's not smooth).