Fish drop
This commit is contained in:
parent
c997cf43fc
commit
4e8ff83a0f
1 changed files with 7 additions and 0 deletions
|
@ -5,6 +5,7 @@ import java.util.Random;
|
|||
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.ItemEntity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.SpawnReason;
|
||||
import net.minecraft.entity.attribute.DefaultAttributeContainer;
|
||||
|
@ -115,4 +116,10 @@ public class EntityEndFish extends SchoolingFishEntity {
|
|||
List<EntityEndFish> list = world.getEntitiesByClass(EntityEndFish.class, box, (entity) -> { return true; });
|
||||
return list.size() < 9;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dropLoot(DamageSource source, boolean causedByPlayer) {
|
||||
ItemEntity drop = new ItemEntity(world, getX(), getY(), getZ(), new ItemStack(EndItems.END_FISH_RAW));
|
||||
this.world.spawnEntity(drop);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue