use of com.teamresourceful.resourcefulbees.entity.passive.ResourcefulBee in project ResourcefulBees by Resourceful-Bees.
the class BeeJar method setBeeAngry.
public static void setBeeAngry(Bee beeEntity, Player player) {
if (beeEntity.isAngry()) {
beeEntity.setTarget(player);
if (beeEntity instanceof ResourcefulBee) {
ResourcefulBee customBee = (ResourcefulBee) beeEntity;
TraitData traitData = customBee.getTraitData();
if (traitData.getDamageTypes().stream().anyMatch(damageType -> damageType.getType().equals(TraitConstants.EXPLOSIVE))) {
customBee.setExplosiveCooldown(60);
}
}
}
}
use of com.teamresourceful.resourcefulbees.entity.passive.ResourcefulBee in project ResourcefulBees by Resourceful-Bees.
the class RegistryHandler method registerBee.
private static void registerBee(String name, float sizeModifier) {
final RegistryObject<EntityType<? extends CustomBeeEntity>> customBeeEntity = ENTITY_TYPES.register(name + "_bee", () -> EntityType.Builder.<ResourcefulBee>of((type, world) -> new ResourcefulBee(type, world, name), ModConstants.BEE_MOB_CATEGORY).sized(0.7F * sizeModifier, 0.6F * sizeModifier).build(name + "_bee"));
ModItems.ITEMS.register(name + "_bee_spawn_egg", () -> new BeeSpawnEggItem(customBeeEntity, 0xffcc33, 0x303030, name, new Item.Properties().tab(ItemGroupResourcefulBees.RESOURCEFUL_BEES)));
ModEntities.getModBees().put(name, customBeeEntity);
}
Aggregations