Source:
<code>public void onPlayerInteract(final PlayerInteractEvent event) { boolean updateActivity = true; switch (event.getAction()) { case RIGHT_CLICK_BLOCK: if (!event.isCancelled() && MaterialUtil.isBed(event.getClickedBlock().getType()) && ess.getSettings().getUpdateBedAtDaytime()) { User player = ess.getUser(event.getPlayer()); if (player.isAuthorized("essentials.sethome.bed") && player.getWorld().getEnvironment().equals(World.Environment.NORMAL)) { player.getBase().setBedSpawnLocation(event.getClickedBlock().getLocation()); player.sendMessage(tl("bedSet", player.getLocation().getWorld().getName(), player.getLocation().getBlockX(), player.getLocation().getBlockY(), player.getLocation().getBlockZ())); } } break; case LEFT_CLICK_AIR: if (event.getPlayer().isFlying()) { final User user = ess.getUser(event.getPlayer()); if (user.isFlyClickJump()) { useFlyClickJump(user); break; } } case LEFT_CLICK_BLOCK: if (event.getItem() != null && event.getItem().getType() != Material.AIR) { final User user = ess.getUser(event.getPlayer()); if (user.hasPowerTools() && user.arePowerToolsEnabled() && usePowertools(user, event.getItem().getType())) { event.setCancelled(true); } } break; case PHYSICAL: <START> if(event.getItem().getType().toString().contains("pressure_plate")) { <END> final User user = ess.getUser(event.getPlayer()); if(user.isVanished()){ event.setCancelled(true); }} updateActivity = false; break; } if (updateActivity) { ess.getUser(event.getPlayer()).updateActivityOnInteract(true); } }</code><technical_language>This work for multiple reasons: * PlayerInteractEvent#getItem returns item interact block, block block interacted - PlayerInteractEvent#getClickedBlock. * string representation of Bukkit Materials is in uppercase. Please fix spacing if</technical_language>

Target:
public void onPlayerInteract(final PlayerInteractEvent event) { boolean updateActivity = true; switch (event.getAction()) { case RIGHT_CLICK_BLOCK: if (!event.isCancelled() && MaterialUtil.isBed(event.getClickedBlock().getType()) && ess.getSettings().getUpdateBedAtDaytime()) { User player = ess.getUser(event.getPlayer()); if (player.isAuthorized("essentials.sethome.bed") && player.getWorld().getEnvironment().equals(World.Environment.NORMAL)) { player.getBase().setBedSpawnLocation(event.getClickedBlock().getLocation()); player.sendMessage(tl("bedSet", player.getLocation().getWorld().getName(), player.getLocation().getBlockX(), player.getLocation().getBlockY(), player.getLocation().getBlockZ())); } } break; case LEFT_CLICK_AIR: if (event.getPlayer().isFlying()) { final User user = ess.getUser(event.getPlayer()); if (user.isFlyClickJump()) { useFlyClickJump(user); break; } } case LEFT_CLICK_BLOCK: if (event.getItem() != null && event.getItem().getType() != Material.AIR) { final User user = ess.getUser(event.getPlayer()); if (user.hasPowerTools() && user.arePowerToolsEnabled() && usePowertools(user, event.getItem().getType())) { event.setCancelled(true); } } break; case PHYSICAL: if(event.getClickedBlock().getType().toString().contains("PRESSURE_PLATE")) { final User user = ess.getUser(event.getPlayer()); if(user.isVanished()){ event.setCancelled(true); } } updateActivity = false; break; } if (updateActivity) { ess.getUser(event.getPlayer()).updateActivityOnInteract(true); } }