Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Easy fix for the fence glitch
- // Just paste this code into your main class and done!
- // code by @mattibijnens
- @SuppressWarnings("deprecation")
- @EventHandler
- public void interactd(PlayerInteractEvent e){
- if(e.getAction() == Action.RIGHT_CLICK_BLOCK){
- if(e.getClickedBlock().getType() == Material.FENCE){
- if((e.getPlayer().getItemInHand().getType().isEdible()) || e.getPlayer().getItemInHand().getTypeId() == 373){
- e.setCancelled(true);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement