Disguise player as Block

Discussion in 'Plugin Development' started by CentrumGuy, Sep 18, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    CentrumGuy

    Hello guys. I'd like to find out how to disguise a player as a block. @Comphenix you might know the answer to how to do this with packets or protocolLib. By the way if you guys don't know what I mean, you can look at mineplex's hide and seek game. That will give you a pretty good idea. I basically want the player to disguise as a falling block.
     
  2. Offline

    boomboompower

    What minecraft version is this for?
     
  3. Offline

    CentrumGuy

    Any 1.8 version
     
  4. Offline

    ShadowRanger

  5. Offline

    CentrumGuy

  6. Offline

    Zombie_Striker

    @CentrumGuy
    Then do the following:
    1. Create a hashmap for Player, Material, this will store the player's block.
    2. Create an arraylist of UUID (this stores all the summoned sand blocks)
    3. Create a repeating task. If you can, shrink the delay from 20L to possible 2L (if you're server is good and does not have that much lag)
    4. Remove all the entities from arraylist (World.getEntities(UUID).remove), and tehn clear arraylist.
    5. Inside this loop, look to see of the hashmap contains the player , and if so, hide him from all players online (Player.hide(Player)) and summon a sand block with the material of that from the hashmap.
    6. Set it so the sand block can never land.
     
  7. Offline

    L3N

    @Zombie_Striker not for Player, Material but for String, Material, well I guess you know why just forgot..

    @CentrumGuy You actually can't disguise as Block but as FallingBlock/FallingSand instead.

    EDIT by Timtower: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Sep 21, 2015
  8. Offline

    Zombie_Striker

    I do not understand this. Do you mind "refrazing" what you just said.

    You can though. Hide the player from all other players online and send all the other players a packet that add a block at the players location (Player.sendBlockUpdate(Location,Block) or something like that)
     
  9. Offline

    L3N

    Yea but disguising as fallingsand would be A LOT less laggy, ANYWAYS what I meant to say is not to store Player in the hashmap but instead store String of the player's name.
     
  10. Offline

    boomboompower

    What popular servers do is disguise the players as baby chickens, then put a falling block/sand over that.
     
  11. Offline

    Zombie_Striker

    @L3N
    Yes, you should not store the player but their UUID (you should use UUID if you are using 1.7+)

    As far as Disguising:
     
    L3N likes this.
  12. Offline

    L3N

    @Zombie_Striker Though in this case doesn't matter since you're not storing his data in config or something that is meant to be just for him, like there won't be more players with his name in the hashmap xD
     
  13. Offline

    CentrumGuy

    How can I make it so falling sand doesn't turn into a block when it touches the ground?
    I tried canceling the EntityChangeBlockEvent when the getTo() != Material.AIR and then spawning a new falling block in that same location but it made it look glitchy (the block's velocity was messed up) anybody have an idea?
     
  14. Offline

    CentrumGuy

  15. Offline

    Zombie_Striker

    You can also try Silver fish, baby zombies, (and if you're on 1.8+) Endermites.
     
  16. Offline

    CentrumGuy

    My main issue now is keeping the block from turning solid. Does anyone have any clue on how to make a falling block stay as an entity @Comphenix ?
     
  17. Offline

    Zombie_Striker

    @CentrumGuy
    Having a falling block riding an entity will prevent it from turning into a block.
     
  18. Offline

    CentrumGuy

    I tried making the falling block ride an invisible armor stand but
    1. You can't teleport an entity if it has a passenger
    2. When the block riding the armor stand was close to another block, the falling block turned into a normal block

    :(
     
  19. Offline

    Zombie_Striker

    @CentrumGuy
    Then the next step would be to create your own custom entity.
     
  20. Offline

    CentrumGuy

    Is there a way I could do that using protocolLib and if there is could you post a link or show me how I would make a custom falling block?
     
  21. Offline

    ChintziSecilMC

Thread Status:
Not open for further replies.

Share This Page