Easy fence glitch fix!

Discussion in 'Resources' started by mattibijnens, May 31, 2014.

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

    mattibijnens

    Hello everyone! To start this off, here is an example of how the fence glitch works: (Skip too 1:55)

    Just add the following code into your class:
    Code:java
    1. // code by @ mattibijnens
    2. @SuppressWarnings("deprecation")
    3. @EventHandler
    4. public void interactd(PlayerInteractEvent e){
    5. if(e.getAction() == Action.RIGHT_CLICK_BLOCK){
    6. if(e.getClickedBlock().getType() == Material.FENCE){
    7. if((e.getPlayer().getItemInHand().getType().isEdible()) || e.getPlayer().getItemInHand().getTypeId() == 373){
    8. e.setCancelled(true);
    9. }
    10. }
    11. }
    12. }
     
    Phasesaber and Wruczek like this.
  2. Offline

    Phasesaber

    Don't use getTypeId, just use getType.
     
Thread Status:
Not open for further replies.

Share This Page