Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public ActionResultType func_230254_b_(PlayerEntity player, Hand hand) {
- ItemStack itemstack = player.getHeldItem(hand);
- Item item = itemstack.getItem();
- ActionResultType type = super.func_230254_b_(player, hand);
- if(item == Items.ROTTEN_FLESH && !isTamed()){
- int size = itemstack.getCount();
- int tameAmount = 58 + rand.nextInt(16);
- if(size > tameAmount){
- this.setTamedBy(player);
- }
- itemstack.shrink(size);
- return ActionResultType.SUCCESS;
- }
- if(type != ActionResultType.SUCCESS && isTamed() && isOwner(player)){
- if(isBreedingItem(itemstack)){
- this.setInLove(600);
- this.consumeItemFromStack(player, itemstack);
- return ActionResultType.SUCCESS;
- }
- if(!player.isSneaking() && !isBreedingItem(itemstack)){
- player.startRiding(this);
- return ActionResultType.SUCCESS;
- }
- }
- return type;
- }
Add Comment
Please, Sign In to add comment