use of net.minecraft.world.effect.MobEffectInstance in project Tropicraft by Tropicraft.
the class MonkeySitAndDrinkGoal method tick.
@Override
public void tick() {
waitCounter--;
if (waitCounter <= 0) {
entity.startUsingItem(InteractionHand.MAIN_HAND);
}
// If drinking complete
ItemStack heldStack = entity.getMainHandItem();
if (heldStack.getItem() == TropicraftItems.BAMBOO_MUG.get()) {
entity.addEffect(new MobEffectInstance(MobEffects.CONFUSION, 10 * 20, 2));
}
}
use of net.minecraft.world.effect.MobEffectInstance in project Tropicraft by Tropicraft.
the class EntityKoaBase method monitorHomeVillage.
public void monitorHomeVillage() {
if (villageDimension != null) {
// if not in home dimension, full reset
if (this.level.dimension() != villageDimension) {
dbg("koa detected different dimension, zapping memory");
zapMemory();
addEffect(new MobEffectInstance(MobEffects.MOVEMENT_SLOWDOWN, 5));
}
// }
}
// TODO: 1.14 re-add
// findOrCreateNewVillage();
}
use of net.minecraft.world.effect.MobEffectInstance in project Tropicraft by Tropicraft.
the class TropiCreeperEntity method spawnLingeringCloud.
private void spawnLingeringCloud() {
Collection<MobEffectInstance> collection = this.getActiveEffects();
if (!collection.isEmpty()) {
AreaEffectCloud areaeffectcloudentity = new AreaEffectCloud(level, getX(), getY(), getZ());
areaeffectcloudentity.setRadius(2.5F);
areaeffectcloudentity.setRadiusOnUse(-0.5F);
areaeffectcloudentity.setWaitTime(10);
areaeffectcloudentity.setDuration(areaeffectcloudentity.getDuration() / 2);
areaeffectcloudentity.setRadiusPerTick(-areaeffectcloudentity.getRadius() / (float) areaeffectcloudentity.getDuration());
for (MobEffectInstance effectinstance : collection) {
areaeffectcloudentity.addEffect(new MobEffectInstance(effectinstance));
}
this.level.addFreshEntity(areaeffectcloudentity);
}
}
Aggregations