Jump to content

Lifesteal Sword Help Needed 1.20.2


LittleLDude

Recommended Posts

I'm trying to make a sword that gives you an extra heart while it's in your inventory for every kill youv'e gotten with it, It can only give up to 5 hearts at once and everytime you die and recover the sword it will give you one less heart.

Here's what I Have so far

package com.legendaryldude.collectorssmpmod.item.items;

import net.minecraft.network.chat.Component;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.SwordItem;
import net.minecraft.world.item.Tier;
import net.minecraft.world.item.TooltipFlag;
import net.minecraft.world.level.Level;

import java.util.List;

public class HeartsBane extends SwordItem {
    public HeartsBane(Tier tier, int damage, float atkspeed, Properties properties) {
        super(tier, damage, atkspeed, properties);
    }
    @Override
    public void appendHoverText(ItemStack stack, Level level, List<Component> component, TooltipFlag flag) {
        component.add(Component.literal("A Stealer Of Hearts"));
        component.add(Component.literal("   Utility Weapon  "));
        component.add(Component.literal(""));
        component.add(Component.literal("When Killing Players With"));
        component.add(Component.literal("This Weapon, Gives You 1"));
        component.add(Component.literal("Extra Max Heart. Up To Five"));
        component.add(Component.literal("Extra Hearts At Once. Hearts"));
        component.add(Component.literal("Apply As Long As I'm In Your"));
        component.add(Component.literal("Inventory."));

        super.appendHoverText(stack, level, component, flag);
    }
}

Ty in advance for help, have a great day

Edited by LittleLDude
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.