Search in sources :

Example 1 with EndGatewayBlockEntity

use of net.minecraft.block.entity.EndGatewayBlockEntity in project Neutrino by FrostWizard4.

the class EndGatewayBlockEntityMixin method serverTick.

@Inject(at = @At("HEAD"), method = "serverTick")
private static void serverTick(World world, BlockPos pos, BlockState state, EndGatewayBlockEntity blockEntity, CallbackInfo ci) {
    if (world instanceof ServerWorld) {
        if (world.getTime() % 100L == 0L) {
            for (MobEntity e : world.getEntitiesByClass(MobEntity.class, Box.of(Vec3d.ofCenter(pos), 1000, 1000, 1000), EndGatewayBlockEntity::canTeleport)) {
                e.addStatusEffect(new StatusEffectInstance(StatusEffects.STRENGTH, 1200, 1));
                e.addStatusEffect(new StatusEffectInstance(StatusEffects.REGENERATION, 1200, 1));
                e.addStatusEffect(new StatusEffectInstance(StatusEffects.SPEED, 1200, 2));
                e.addStatusEffect(new StatusEffectInstance(StatusEffects.ABSORPTION, 1200, 1));
            }
        }
    }
}
Also used : ServerWorld(net.minecraft.server.world.ServerWorld) EndGatewayBlockEntity(net.minecraft.block.entity.EndGatewayBlockEntity) StatusEffectInstance(net.minecraft.entity.effect.StatusEffectInstance) MobEntity(net.minecraft.entity.mob.MobEntity) Inject(org.spongepowered.asm.mixin.injection.Inject)

Aggregations

EndGatewayBlockEntity (net.minecraft.block.entity.EndGatewayBlockEntity)1 StatusEffectInstance (net.minecraft.entity.effect.StatusEffectInstance)1 MobEntity (net.minecraft.entity.mob.MobEntity)1 ServerWorld (net.minecraft.server.world.ServerWorld)1 Inject (org.spongepowered.asm.mixin.injection.Inject)1