Hiding Rails and Blocks

Discussion in 'Plugin Development' started by floop222, Jan 10, 2015.

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

    floop222

    Hello Guys, So ive been trying to make this for a while and I figured out it was sendBlockChange() I tried multiple ways of doing this like doing a command and it sends the block change but it doesn't work any ideas? I tried using worldedit too but that failed? any ideas!?
     
  2. @floop222 @timtower has made that before, when he is available. I am sure he will help you.
     
  3. Offline

    floop222

    @bwfcwalshy ok thx, I just need to learn the hiding bit
     
  4. Offline

    timtower Administrator Administrator Moderator

    @floop222 Didn't you ask this before? ProtocolLib.
    And what isn't working then?
     
  5. Offline

    floop222

  6. @floop222
     
  7. Offline

    floop222

    Code:
    @SuppressWarnings("deprecation")
         @EventHandler
         public void getGrave(PlayerDeathEvent e) {
            System.out.println("event found");
        for(Player p : Bukkit.getOnlinePlayers()) {
                 Location loc = e.getEntity().getLocation();
             Block block = loc.getBlock();
            
                Block signBlock = block.getRelative(BlockFace.NORTH).getRelative(BlockFace.EAST);
                p.sendBlockChange(signBlock.getLocation(), Material.SIGN_POST, (byte) 0xD);
                              String[] lines = {
                    ChatColor.translateAlternateColorCodes('&', "&F&lR.I.P"),
                    e.getEntity().getName(),
                    "RIP",
                };         
                EntityPlayer player = ((CraftPlayer) p).getHandle();
            player.playerConnection.sendPacket(new PacketPlayOutUpdateSign(signBlock.getX(), signBlock.getY(), signBlock.getZ(), lines));
            p.sendBlockChange(block.getLocation(), Material.MOSSY_COBBLESTONE, block.getData());
                 Block blockSkeleton = block.getRelative(BlockFace.UP);
                 p.sendBlockChange(blockSkeleton.getLocation(), Material.SKULL, (byte) 0);
                Block redstone1 = block.getRelative(BlockFace.EAST);
                p.sendBlockChange(redstone1.getLocation(), Material.REDSTONE_WIRE, redstone1.getData());
                 Block redstone2 = redstone1.getRelative(BlockFace.EAST);
                p.sendBlockChange(redstone2.getLocation(), Material.REDSTONE_WIRE, redstone2.getData());
                 Block redstone3 = redstone2.getRelative(BlockFace.SOUTH);
                p.sendBlockChange(redstone3.getLocation(), Material.REDSTONE_WIRE, redstone3.getData());
                Block fire = redstone3.getRelative(BlockFace.WEST);
                p.sendBlockChange(fire.getLocation(), Material.FIRE, fire.getData());
            }
        }
    }
    
    That wont work
     
  8. Offline

    floop222

    @bwfcwalshy it says it shouldn't be decapreated but I thought it should be
     
  9. Offline

    floop222

Thread Status:
Not open for further replies.

Share This Page