Java Code Examples for cn.nukkit.item.Item#WHEAT_SEEDS
The following examples show how to use
cn.nukkit.item.Item#WHEAT_SEEDS .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Chicken.java From Actaeon with MIT License | 6 votes |
@Override public boolean entityBaseTick(int tickDiff){ if(!this.hasTarget()){ Entity[] entities = this.level.getNearbyEntities(new AxisAlignedBB(this.x, this.y, this.z, this.x, this.y, this.z).expand(7, 7, 7)); Entity near = null; for(Entity entity : entities){ if(entity instanceof Player && (near == null || this.distance(near) < this.distance(entity))){ if(((Player) entity).getInventory().getItemInHand().getId() == Item.WHEAT_SEEDS){ near = entity; } } } this.setTarget(near, "Chicken"); } return super.entityBaseTick(tickDiff); }
Example 2
Source File: EntityChicken.java From Jupiter with GNU General Public License v3.0 | 4 votes |
@Override public boolean isBreedingItem(Item item) { int id = item.getId(); return id == Item.WHEAT_SEEDS || id == Item.MELON_SEEDS || id == Item.PUMPKIN_SEEDS || id == Item.BEETROOT_SEEDS; }
Example 3
Source File: EntityChicken.java From Nukkit with GNU General Public License v3.0 | 4 votes |
@Override public boolean isBreedingItem(Item item) { int id = item.getId(); return id == Item.WHEAT_SEEDS || id == Item.MELON_SEEDS || id == Item.PUMPKIN_SEEDS || id == Item.BEETROOT_SEEDS; }
Example 4
Source File: EntityChicken.java From Nukkit with GNU General Public License v3.0 | 4 votes |
@Override public boolean isBreedingItem(Item item) { int id = item.getId(); return id == Item.WHEAT_SEEDS || id == Item.MELON_SEEDS || id == Item.PUMPKIN_SEEDS || id == Item.BEETROOT_SEEDS; }