Fake Blocks

Discussion in 'Spigot Plugin Development' started by elio, May 2, 2015.

  1. Hi,
    I want to displays to a specific player a block, but the block must be only visible for him. I know I have to use protocolib but I don't know how.
    Can you help me?
  2. Create a PacketPlayOutBlockChange
    Change the fields block and data using reflection
    Send to player
    • Agree Agree x 1
  3. Player#sendBlockChange
    Is easy enough. Even though it's deprecated it still works and you don't need protocol lib.
    • Agree Agree x 2
    • Informative Informative x 1
  4. Don't use packets, you can use sendBlockChange() like VenomEater552 said. Keep in mind though, that the blocks dissapear if the player rightclicks them. If you're trying to use those blocks to prevent players entering certain areas, either send the block updates in a repeating task or add a second check to tp them back if they enter the area.
  5. You can use:
    player.sendBlockChange() to change block.
  6. If I recall correctly, cancelling the PlayerInteractEvent will prevent that from happening - needs verification though, I'm not sure :p.
    • Informative Informative x 1
  7. Just tested it, results came with the block disappearing anyway.
    • Informative Informative x 1
  8. If you know Java you van do this....
  9. Incorrect answer,
    It's not because there are other threads with people asking to spoonfeed that you have to post this everywhere.

    Oh, I'd rather not want to get in your 'van'.
    • Agree Agree x 1