org.bukkit.entity.MushroomCow Java Examples

The following examples show how to use org.bukkit.entity.MushroomCow. 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: MooshroomTrait.java    From StackMob-3 with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean checkTrait(Entity original, Entity nearby) {
    if (original instanceof MushroomCow) {
        return ((MushroomCow) original).getVariant() != ((MushroomCow) nearby).getVariant();
    }
    return false;
}
 
Example #2
Source File: MooshroomTrait.java    From StackMob-3 with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void applyTrait(Entity original, Entity spawned) {
    if (original instanceof MushroomCow) {
        ((MushroomCow) spawned).setVariant(((MushroomCow) original).getVariant());
    }
}
 
Example #3
Source File: MooshroomData.java    From Skript with GNU General Public License v3.0 4 votes vote down vote up
@Override
protected boolean init(@Nullable Class<? extends MushroomCow> c, @Nullable MushroomCow mushroomCow) {
	if (mushroomCow != null)
		variant = mushroomCow.getVariant();
	return true;
}
 
Example #4
Source File: MooshroomData.java    From Skript with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void set(MushroomCow entity) {
	if (variant != null)
		entity.setVariant(variant);
}
 
Example #5
Source File: MooshroomData.java    From Skript with GNU General Public License v3.0 4 votes vote down vote up
@Override
protected boolean match(MushroomCow entity) {
	return variant == null || variant == entity.getVariant();
}
 
Example #6
Source File: MooshroomData.java    From Skript with GNU General Public License v3.0 4 votes vote down vote up
@Override
public Class<? extends MushroomCow> getType() {
	return MushroomCow.class;
}
 
Example #7
Source File: MushroomCowHandler.java    From EliteMobs with GNU General Public License v3.0 4 votes vote down vote up
@EventHandler
public void onShear(PlayerShearEntityEvent event) {

    if (event.getEntity() instanceof MushroomCow && EntityTracker.isSuperMob(event.getEntity())) {

        MushroomCow mushroomCow = (MushroomCow) event.getEntity();

        ItemStack mushroomStack = new ItemStack(RED_MUSHROOM, 5);

        for (int i = 0; i < 50; i++) {

            mushroomCow.getWorld().dropItem(mushroomCow.getLocation(), mushroomStack).setVelocity(ItemDropVelocity.ItemDropVelocity());

        }

    }

}