This commit is contained in:
Sunskimmer822 2022-03-03 07:52:29 -06:00
parent 5862e84364
commit 12789ce26f
2 changed files with 30 additions and 0 deletions

View File

@ -38,6 +38,10 @@ public class Shitmod implements ModInitializer {
public static final ItemGroup CHARMS_GROUP = FabricItemGroupBuilder.build(
new Identifier("shitmod", "charms"),
() -> new ItemStack(Shitmod.KINGSOUL_CHARM));
public static final ItemGroup GENERAL_GROUP = FabricItemGroupBuilder.build(
new Identifier("shitmod", "general"),
() -> new ItemStack(Shitmod.FABRIC_ITEM));
public static final Item KINGSOUL_CHARM = new kingsoul(new Item.Settings().group(Shitmod.CHARMS_GROUP).maxDamage(500).fireproof());
@ -53,6 +57,8 @@ public class Shitmod implements ModInitializer {
public static final Item UNBREAKABLE_STRENGTH_CHARM = new unbreakableStrengthCharm(new Item.Settings().group(Shitmod.CHARMS_GROUP).fireproof().maxCount(1));
public static final Item TOTEM_OF_EQUIVALENCY = new totemOfEquivalency(new Item.Settings().group(Shitmod.GENERAL_GROUP).maxCount(1));
@Override
public void onInitialize() {
@ -85,6 +91,8 @@ public class Shitmod implements ModInitializer {
Registry.register(Registry.ITEM, new Identifier("shitmod", "unbreakable_strength_charm"), UNBREAKABLE_STRENGTH_CHARM);
Registry.register(Registry.ITEM, new Identifier("shitmod", "totem_of_equivalency"), TOTEM_OF_EQUIVALENCY);
CustomPortalBuilder.beginPortal()
.frameBlock(Blocks.DIAMOND_BLOCK)
.lightWithItem(Items.ENDER_EYE)

View File

@ -0,0 +1,22 @@
package net.serenas.shitmod;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.TypedActionResult;
import net.minecraft.world.World;
public class totemOfEquivalency extends Item {
public totemOfEquivalency(Settings settings) {
super(settings);
}
@Override
public TypedActionResult<ItemStack> use(World World, PlayerEntity PlayerEntity, Hand Hand) {
PlayerEntity.kill();
return new TypedActionResult<ItemStack>(ActionResult.SUCCESS, PlayerEntity.getStackInHand(Hand));
}
}