Putopug

AAAAAAAAAAAAAAAAAAAAAAAA

Mar 11th, 2021
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.06 KB | None | 0 0
  1.  public ActionResultType func_230254_b_(PlayerEntity player, Hand hand) {
  2.         ItemStack itemstack = player.getHeldItem(hand);
  3.         Item item = itemstack.getItem();
  4.         ActionResultType type = super.func_230254_b_(player, hand);
  5.  
  6.         if(item == Items.ROTTEN_FLESH && !isTamed()){
  7.             int size = itemstack.getCount();
  8.             int tameAmount = 58 + rand.nextInt(16);
  9.             if(size > tameAmount){
  10.                 this.setTamedBy(player);
  11.             }
  12.             itemstack.shrink(size);
  13.             return ActionResultType.SUCCESS;
  14.         }
  15.         if(type != ActionResultType.SUCCESS && isTamed() && isOwner(player)){
  16.             if(isBreedingItem(itemstack)){
  17.                 this.setInLove(600);
  18.                 this.consumeItemFromStack(player, itemstack);
  19.                 return ActionResultType.SUCCESS;
  20.             }
  21.             if(!player.isSneaking() && !isBreedingItem(itemstack)){
  22.                 player.startRiding(this);
  23.                 return ActionResultType.SUCCESS;
  24.             }
  25.         }
  26.         return type;
  27.     }
Add Comment
Please, Sign In to add comment