boom
This commit is contained in:
parent
c491cc4c1b
commit
93e8100c49
@ -5,6 +5,7 @@ import net.fabricmc.fabric.api.client.itemgroup.FabricItemGroupBuilder;
|
||||
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
|
||||
import net.kyrptonaught.customportalapi.api.CustomPortalBuilder;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.entity.effect.StatusEffect;
|
||||
import net.minecraft.entity.effect.StatusEffectInstance;
|
||||
import net.minecraft.entity.effect.StatusEffects;
|
||||
@ -82,6 +83,8 @@ public class Shitmod implements ModInitializer {
|
||||
|
||||
public static final Item BLAZE_METAL_INGOT = new blazeMetalIngot(new Item.Settings().group(Shitmod.GENERAL_GROUP));
|
||||
|
||||
public static final Enchantment EXPLOSION_ASPECT = new explosionAspectEnchantment();
|
||||
|
||||
@Override
|
||||
public void onInitialize() {
|
||||
|
||||
@ -134,6 +137,8 @@ public class Shitmod implements ModInitializer {
|
||||
|
||||
Registry.register(Registry.ITEM, new Identifier("shitmod", "blaze_metal_ingot"), BLAZE_METAL_INGOT);
|
||||
|
||||
Registry.register(Registry.ENCHANTMENT, new Identifier("shitmod", "explosion_aspect"), EXPLOSION_ASPECT);
|
||||
|
||||
CustomPortalBuilder.beginPortal()
|
||||
.frameBlock(Shitmod.FABRIC_BLOCK)
|
||||
.lightWithItem(Shitmod.BLAZE_METAL_INGOT)
|
||||
|
@ -0,0 +1,38 @@
|
||||
package net.serenas.shitmod;
|
||||
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.enchantment.EnchantmentTarget;
|
||||
import net.minecraft.entity.EquipmentSlot;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.explosion.Explosion;
|
||||
|
||||
public class explosionAspectEnchantment extends Enchantment {
|
||||
|
||||
protected explosionAspectEnchantment() {
|
||||
super(Enchantment.Rarity.RARE, EnchantmentTarget.WEAPON, new EquipmentSlot[] {EquipmentSlot.MAINHAND});
|
||||
|
||||
}
|
||||
|
||||
@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, Explosion.DestructionType.BREAK);
|
||||
}
|
||||
super.onTargetDamaged(user, target, level);
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user