Block disguise

Discussion in 'Plugin Development' started by Funergy, Apr 10, 2014.

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

    Funergy

    How can I disguise a player as a block?
    I'm making a hide and seek plugin thingy and I wanna know how to disguise a player
    is it with packets? teleporting a falling entity???
    Comphenix
     
  2. Offline

    JBoss925

    Lol I saw you ask for help on your "sneak peek." And it takes 4 seconds of googling.
     
  3. Offline

    Funergy

    4 seconds of googling I don't think so...
    oh yeah I didn't even use that answer from that thread. I started with making a circle and picking 1 certain place in the circle so I didn't found it on internet
     
  4. Offline

    IamHD

    I don't know much about how this could be done in Minecraft but I assume you have to go to the lower levels of the server and deny all the packets sending the position of the the hidden player to the seeker. Then just position a flying block where that hidden player is at(I'm guessing this could be done as a higher level or a lower level). If the player stays still for an amount of period, set the block to a solid then.
     
  5. Offline

    Funergy

    Anyone?
     
  6. Offline

    itzrobotix

  7. Offline

    Funergy

  8. Offline

    itzrobotix

    Have fun and good luck.
     
  9. Offline

    Funergy

    ok

    I have this now but how can I spawn only one falling block and teleport it to the player
    Can you please send me some code for how to do this
    Code:
    @EventHandler
        public void playermoveevent(PlayerMoveEvent e){
            Bukkit.getWorld("world").spawnFallingBlock(e.getPlayer().getLocation(), Material.SNOW_BLOCK, (byte) 0);
        }
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 7, 2016
  10. Offline

    Mr.PuddinPop

    remov the block 'x' amount of ticks later.
     
  11. Offline

    iZanax

    What I suggest, without having to hook into packets/dependencies.
    - Make all disguised players invisible to other players
    - Create a FallingBlock for each disguised player and keep track of this
    - Teleport this FallingBlock entity every tick
    - Keep in mind that you always have to place it like for example 0.1-0.35Y above the player, otherwise it might instantly update on the ground beneath it and won't show.
     
  12. Offline

    BillyBobJoe168

  13. Offline

    JBoss925

  14. Offline

    xTrollxDudex

    I hope you have a fun getting warned for off topic post.

    Funergy
    If you are totally serious about not using an API and reinventing the wheel (again), good luck.

    1. Intercept player vis
    2. Build entity
    3. Send as player
    4. Update
    5. Redo
     
  15. Offline

    JBoss925

    It wasn't really off topic. It showed that all he had to do was look it up. And Funergy it's really not worth it to go through all this trouble without doing research first.
     
  16. Offline

    xTrollxDudex

    JBoss925
    OH MY GOD THAT WAS MY SITE HAHAHAH

    Very on topic.
     
  17. Offline

    JBoss925

    What? I didn't even claim it as mine and I thought it was funny and demonstrated very well that just looking something up before spamming the forums is probably a good idea. It's annoying when people come to ask for help on how to use a plugin.yml without looking at the plugin tutorial page. It's the same concept. Just look it up before asking bukkit it's that simple.
     
  18. Offline

    xTrollxDudex

    JBoss925
    Alright let's put it the simple way:

    Did your post contribute to the thread?
    Did it help OP solve problem?
    Is it an absolutely essential element to the topic?

    I would say what you are thinking as you read that post as a no.
     
  19. Offline

    Funergy

    Thats what I did before I posted this thread so don't say that I didn't search it on google.
    If you say that I can find a code that is WITHOUD protocollib and WITHOUD disguise api.
    If yes show me It http://lmgtfy.com/?q=bukkit code to disguise a player as a block I can't see there any answers that are withoud dependings!
    And then I have post it on a new thread!
     
  20. Offline

    Zethariel

    Funergy OP is like "guys, help me make this thing that X has, only different, and tell me how to do it despite having perfectly good examples in their APIs"

    You will have to play around with sending packets - fooling the client into thinking there is a block there.
     
  21. If you have no idea how to do this then I doubt you're skilled enough to create your own PacketInterceptor. There's nothing wrong with using API's and definately when it comes to protocol-stuff.

    Anyways, feel free to do whatever you want, no one is going to stop you but if you decide to make your own implementation then please make sure it is safe.
    Here are the steps to achieve what you want:
    - Capture the PacketPlayOutSpawnNamedEntity -> Transform it to a PacketPlayOutBlockChange
    - Capture the movement packets -> check if the player that moved is disguised -> if so, send a new PacketPlayOutBlockChange where you set the old block/location to air and then send another one with the updated location.

    If you really don't want to depend on ProtocolLib then take a look at TinyProtocol.
     
    Zethariel likes this.
  22. Offline

    xTrollxDudex

    CaptainBern
    True, only 2 people have done a public packet handling API ( Comphenix and bigteddy )
     
  23. Offline

    JBoss925

    Arguing about this is not worth is. Let's just get over it and stop arguing because this is going nowhere.
     
  24. Offline

    xTrollxDudex

    JBoss925
    I'll end with saying that maybe you should think about what you post next time.
     
Thread Status:
Not open for further replies.

Share This Page