Advertisement
Guest User

Handler.java

a guest
Mar 23rd, 2017
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.53 KB | None | 0 0
  1. public class Handler {
  2.  
  3.     @SubscribeEvent
  4.     public void onEntityUpdate(TickEvent.PlayerTickEvent event){
  5.  
  6.         if(event.phase != TickEvent.Phase.START|| !event.player.worldObj.isRemote) return;
  7.  
  8.         if(event.player.getCurrentArmor(2).getItem() != doPreInit.fairysunwings){
  9.             if(!event.player.capabilities.isCreativeMode) event.player.capabilities.allowFlying = false; event.player.capabilities.isFlying = false;
  10.         }
  11.         else {
  12.             event.player.capabilities.allowFlying = true;
  13.         }
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement