I Want to make the player if player walk on a block like bedrock the player will push back (like in worldguard) I Have search it.. but i couldn't understand how vector works.. Code:java if(player.getLocation().getBlock().getRelative(BlockFace.DOWN).getType() == Material.BEDROCK) { //I don't have any idea what to put here} thanks for your help!
Well if you are using this in PlayerMoveEvent, do the check and do: Code:java event.setCancelled(true);player.teleport(event.getFrom());
Thanks but it glitch the player but i have tweak the code to this and worked! Code:java if(player.getLocation().getBlock().getRelative(BlockFace.DOWN).getType() == Material.BEDROCK) {eventhold.setCancelled(true);player.teleport(eventhold.getFrom().subtract(eventhold.getTo().subtract(eventhold.getFrom())));} but not perfect
tkausl yes, i have tried it with cancel or no but same.. player stuck on it still no EDIT by Moderator: merged posts, please use the edit button instead of double posting.