Java Code Examples for org.bukkit.entity.EntityType#MUSHROOM_COW

The following examples show how to use org.bukkit.entity.EntityType#MUSHROOM_COW . 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: CraftMushroomCow.java    From Kettle with GNU General Public License v3.0 4 votes vote down vote up
public EntityType getType() {
    return EntityType.MUSHROOM_COW;
}
 
Example 2
Source File: SentinelVersionCompat.java    From Sentinel with MIT License 4 votes vote down vote up
static EntityType[] v1_8_passive() {
    return new EntityType[]{
            EntityType.PIG, EntityType.OCELOT, EntityType.COW, EntityType.RABBIT, EntityType.SHEEP, EntityType.CHICKEN, EntityType.MUSHROOM_COW,
            EntityType.HORSE, EntityType.IRON_GOLEM, EntityType.SQUID, EntityType.VILLAGER, EntityType.WOLF, EntityType.SNOWMAN
    };
}
 
Example 3
Source File: SuperMushroomCow.java    From EliteMobs with GNU General Public License v3.0 4 votes vote down vote up
public SuperMushroomCow() {

        this.name = ConfigValues.translationConfig.getString(TranslationConfig.NAME_MUSHROOM_COW);

        this.entityType = EntityType.MUSHROOM_COW;

        this.defaultMaxHealth = 10;

        this.isEnabled = ConfigValues.validMobsConfig.getBoolean(ValidMobsConfig.VALID_SUPERMOBS + getEntityType().toString()) &&
                ConfigValues.validMobsConfig.getBoolean(ValidMobsConfig.ALLOW_PASSIVE_SUPERMOBS);

        if (this.isEnabled) {
            superMobTypeList.add(this.entityType);
            superMobData.add(this);
        }

    }
 
Example 4
Source File: CraftMushroomCow.java    From Thermos with GNU General Public License v3.0 4 votes vote down vote up
public EntityType getType() {
    return EntityType.MUSHROOM_COW;
}
 
Example 5
Source File: SpawnEggMeta.java    From ShopChest with MIT License 4 votes vote down vote up
/**	
 * @param plugin An instance of the {@link ShopChest} plugin
 * @param stack {@link ItemStack} (Spawn Egg) of which the Entity should be gotten	
 * @return The {@link EntityType} the Spawn Egg will spawn or <b>null</b> if <i>nbtEntityID</i> is null	
 */	
public static EntityType getEntityTypeFromItemStack(ShopChest plugin, ItemStack stack) {	
    if (Utils.getMajorVersion() == 8) {	
        EntityType type = null;	
	
        for (EntityType entityType : EntityType.values()) {	
            if (entityType.getTypeId() == stack.getDurability()) {	
                type = entityType;	
                break;	
            }	
        }	
	
        return type;	
    }	
	
    String nbtEntityID = getNBTEntityID(plugin, stack);	
	
    if (nbtEntityID == null) return null;	
	
    if (Utils.getMajorVersion() >= 11) {	
        if (nbtEntityID.contains(":")) nbtEntityID = nbtEntityID.split(":")[1];	
        return EntityType.fromName(nbtEntityID);	
    }	
	
    switch (nbtEntityID) {	
        case "PigZombie":	
            return EntityType.valueOf("PIG_ZOMBIE");	
        case "CaveSpider":	
            return EntityType.CAVE_SPIDER;	
        case "LavaSlime":	
            return EntityType.MAGMA_CUBE;	
        case "MushroomCow":	
            return EntityType.MUSHROOM_COW;	
        case "EntityHorse":	
            return EntityType.HORSE;	
        case "PolarBear":	
            return EntityType.POLAR_BEAR;	
        case "Ozelot":	
            return EntityType.OCELOT;	
        default:	
            return EntityType.valueOf(nbtEntityID.toUpperCase());	
	
    }	
}
 
Example 6
Source File: ScrubEntityType.java    From skRayFall with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Convert a string to a bukkit entity type.
 *
 * @param exprs The string to be converted.
 */
public static EntityType getType(String exprs) {
    switch (exprs.replace("\"", "").toLowerCase().replace("_", " ").replaceFirst("the ", "")) {
        case "player":
        case "the player":
            return EntityType.PLAYER;
        case "pig":
            return EntityType.PIG;
        case "blaze":
            return EntityType.BLAZE;
        case "bat":
            return EntityType.BAT;
        case "chicken":
            return EntityType.CHICKEN;
        case "creeper":
            return EntityType.CREEPER;
        case "cow":
            return EntityType.COW;
        case "enderman":
            return EntityType.ENDERMAN;
        case "ender dragon":
            return EntityType.ENDER_DRAGON;
        case "ghast":
            return EntityType.GHAST;
        case "giant":
            return EntityType.GIANT;
        case "iron golem":
            return EntityType.IRON_GOLEM;
        case "magma cube":
            return EntityType.MAGMA_CUBE;
        case "mushroom cow":
            return EntityType.MUSHROOM_COW;
        case "ocelot":
            return EntityType.OCELOT;
        case "pig zombie":
            return EntityType.PIG_ZOMBIE;
        case "sheep":
            return EntityType.SHEEP;
        case "silverfish":
            return EntityType.SILVERFISH;
        case "squid":
            return EntityType.SQUID;
        case "snowman":
            return EntityType.SNOWMAN;
        case "wolf":
            return EntityType.WOLF;
        case "skeleton":
            return EntityType.SKELETON;
        case "slime":
            return EntityType.SLIME;
        case "spider":
            return EntityType.SPIDER;
        case "witch":
            return EntityType.WITCH;
        case "wither":
            return EntityType.WITHER;
        case "villager":
            return EntityType.VILLAGER;
        case "zombie":
            return EntityType.ZOMBIE;
        case "armor stand":
            return EntityType.ARMOR_STAND;
        case "guardian":
            return EntityType.GUARDIAN;
        default:
            return EntityType.PLAYER;
    }
}