爆炸魔法布雷工模型

aelbi1ox  于 2021-07-12  发布在  Java
关注(0)|答案(0)|浏览(220)

试图使爆炸附魔,让我触发一个小爆炸对暴徒命中。我不希望爆炸造成破坏,但我希望它造成破坏。

import net.minecraft.block.TntBlock;
import net.minecraft.client.util.math.Vector3d;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentTarget;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.TntEntity;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
import net.minecraft.world.explosion.Explosion;

public class ExplosiveAspectEnchantment extends Enchantment {

    protected ExplosiveAspectEnchantment(Rarity weight, EnchantmentTarget target, EquipmentSlot[] equipmentSlots) {
        super(weight, target, equipmentSlots);

    }

    @Override
    public int getMinPower(int level) {
        return 100;
    }

    @Override
    public int getMaxLevel() {
        return 1;
    }

    @Override
    public void onTargetDamaged(LivingEntity user, net.minecraft.entity.Entity target, int level) {
        World world = user.world;
        if (target instanceof LivingEntity) {
            Vec3d pos = target.getPos();
            world.createExplosion(user, pos.x, pos.y, pos.z, 4.0F, );
        }
        super.onTargetDamaged(user, target, level);
    }
}

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题