fireBALLS

This commit is contained in:
Sunskimmer822 2022-03-16 17:00:16 -07:00
parent 93e8100c49
commit d56aeaea32
3 changed files with 51 additions and 4 deletions

View File

@ -15,7 +15,6 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ShovelItem;
import net.minecraft.item.SwordItem;
import net.minecraft.item.ToolItem;
import net.minecraft.util.Identifier;
import net.minecraft.util.Rarity;
@ -23,11 +22,11 @@ import net.minecraft.util.registry.Registry;
public class Shitmod implements ModInitializer {
public static final Item FABRIC_ITEM = new FabricItem(new Item.Settings().group(ItemGroup.MISC));
public static final Item FABRIC_ITEM = new FabricItem(new Item.Settings().group(Shitmod.GENERAL_GROUP));
public static final Block FABRIC_BLOCK = new FabricBlock();
public static final Item HAUSBOMMER_ITEM = new Hausbommer(new Item.Settings().group(ItemGroup.MISC));
public static final Item HAUSBOMMER_ITEM = new Hausbommer(new Item.Settings().group(Shitmod.GENERAL_GROUP));
public static final StatusEffect LEAN_EFFECT = new LeanStatusEffect();
@ -71,7 +70,7 @@ public class Shitmod implements ModInitializer {
public static final Item KINGSOUL_RIGHT = new kingsoulRight(new Item.Settings().group(Shitmod.CHARMS_GROUP).maxCount(1));
public static final ToolItem BLAZE_METAL_SWORD = new SwordItem(blazeMetalMaterial.INSTANCE, 5, 3f, new Item.Settings().group(Shitmod.TOOLS_GROUP));
public static final ToolItem BLAZE_METAL_SWORD = new blazeMetalSword(blazeMetalMaterial.INSTANCE, 5, 3f, new Item.Settings().group(Shitmod.TOOLS_GROUP));
public static final ToolItem BLAZE_METAL_PICKAXE = new blazeMetalPickaxe(blazeMetalMaterial.INSTANCE, 1, -0.5f, new Item.Settings().group(Shitmod.TOOLS_GROUP));

View File

@ -1,11 +1,29 @@
package net.serenas.shitmod;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.projectile.FireballEntity;
import net.minecraft.item.AxeItem;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ToolMaterial;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.TypedActionResult;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
public class blazeMetalAxe extends AxeItem {
public blazeMetalAxe(ToolMaterial material, float attackDamage, float attackSpeed, Settings settings) {
super(material, attackDamage, attackSpeed, settings);
}
@Override
public TypedActionResult<ItemStack> use(World World, PlayerEntity PlayerEntity, Hand Hand) {
Vec3d looking = PlayerEntity.getRotationVector();
World.spawnEntity(new FireballEntity(World, PlayerEntity, looking.x, looking.y, looking.z, 5));
PlayerEntity.getStackInHand(Hand).damage(50,PlayerEntity,e-> e.sendEquipmentBreakStatus(EquipmentSlot.MAINHAND));
return new TypedActionResult<ItemStack>(ActionResult.SUCCESS, PlayerEntity.getStackInHand(Hand));
}
}

View File

@ -0,0 +1,30 @@
package net.serenas.shitmod;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.projectile.FireballEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.item.SwordItem;
import net.minecraft.item.ToolMaterial;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.TypedActionResult;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
public class blazeMetalSword extends SwordItem {
public blazeMetalSword(ToolMaterial toolMaterial, int attackDamage, float attackSpeed, Settings settings) {
super(toolMaterial, attackDamage, attackSpeed, settings);
}
@Override
public TypedActionResult<ItemStack> use(World World, PlayerEntity PlayerEntity, Hand Hand) {
Vec3d looking = PlayerEntity.getRotationVector();
FireballEntity fireball = new FireballEntity(World, PlayerEntity, looking.x, looking.y, looking.z, 5);
World.spawnEntity(fireball);
PlayerEntity.getStackInHand(Hand).damage(50,PlayerEntity,e-> e.sendEquipmentBreakStatus(EquipmentSlot.MAINHAND));
return new TypedActionResult<ItemStack>(ActionResult.SUCCESS, PlayerEntity.getStackInHand(Hand));
}
}