Blocks only some players can see

Discussion in 'Plugin Development' started by Digital64, Feb 17, 2013.

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

    Digital64

    Hey,
    I'm trying to add a feature to my plugin that will allow certain players to go through a wall, but to any player besides them, it will seem to be solid. Is there any way I can inturrupt the normal world stream to make the client think that there is no block there, and permit the player to pass through instead of experiencing glitchy bouncing.
    Thanks,
    64
     
  2. Offline

    Digital64

    Is this even possible?
     
  3. Offline

    xBlazeTECH

    I would like to bump this post. Does anyone have any idea how to do this?
     
  4. Offline

    xTrollxDudex

  5. Offline

    themuteoneS

    Code:java
    1. player.sendBlockChange(Location,Material,Data)

    Not that this will send a change however the block itself will remain. I suggest turning the blocks that make up the wall from air to whatever you want them to be because if you change a solid into air with this the server will not let them walk through the block. However I don't know if you change air to a block if the server/client will not allow the play to walk though. Imma try this out and will edit when i figure it out!
     
  6. Offline

    xBlazeTECH

    I have tried this and it hasn't worked for me. I do not know if anyone else will have better luck. For me, it does nothing when I try to change the block to air.

    I have tried with protocollib, but for some reason it is not identifying this:
    Packet82UpdateSign
    Because apparently it cannot be resolved to a type. I have a snippit of my code below.
    Code:java
    1. manager.addPacketListener(
    2. new PacketAdapter(this, ConnectionSide.SERVER_SIDE,
    3. Packets.Server.UPDATE_SIGN) {
    4. @Override
    5. public void onPacketSending(PacketEvent event) {
    6. if (!event.getPlayer().hasPermission("cansee.sign")) {
    7. Packet82UpdateSign spawnPainting = new Packet82UpdateSign(event.getPacket());
    8. Location loc = new Location(
    9. event.getPlayer().getWorld(),
    10. spawnPainting.getX(), spawnPainting.getY(), spawnPainting.getZ());
    11.  
    12. // Don't update the sign
    13. event.setCancelled(true);
    14.  
    15. // Send the fake block update
    16. event.getPlayer().sendBlockChange(loc, Material.AIR, (byte)0);
    17. }
    18. }
    19. }
    20. );


    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 31, 2016
  7. Offline

    xTrollxDudex

  8. Offline

    themuteoneS

    Sorry if I wasn't clear but I meant that you're supposed to turn a block from air to another material not the other way around or you will be blocked because the server won't let you walk though something it thinks is there! And you also have to make sure you are doing this to a specific player (yourself maybe).
     
Thread Status:
Not open for further replies.

Share This Page