Forumskeyboard_arrow_right Minecraft - Java Edition keyboard_arrow_right Discussion

Create Forum Thread
2

How to make Custom weapon

2 emeralds7 replies113 views
created 01/27/2020 11:42 pm by jGaurd
last reply 01/30/2020 3:07 am
How do I make a sword use Xp on hit? And how do you add food with healing properties such as regen and such? Need help thank you.
Posted by avatar
jGaurd
Level 1 : New Miner
0

comment Login or register to post a reply.

7 replies

2
01/28/2020 4:19 am
Level 20 : Expert Unicorn
HoboMaggot
These both require the use of scoreboards.

The sword: Make a scoreboard that detects use durability while holding the sword. So minecraft.used:minecraft.diamond_sword etc.
When this is successful, just take off xp from the player and reset the score.

Food: You need to make a scoreboard that detects usage of the food (eating), so make the scoreboard with the criterion of minecraft.used:minecraft.cooked_beef
When the food is eaten, give regen to the player who ate it, and reset.
1
01/28/2020 9:57 amhistory
Level 1 : New Miner
jGaurd
Hey thank you so much another question how would I make the sword do more damage at the same time like I want it to do x2.5 damage but use 7 exp
1
01/29/2020 4:57 am
Level 20 : Expert Unicorn
HoboMaggot
You need to make an actual item for that, using attributes. So something like: give @p minecraft:wooden_sword{AttributeModifiers:[{AttributeName:"generic.attackDamage",Name:"generic.attackDamage",Amount:10,Operation:0,UUIDLeast:349195,UUIDMost:244839}]} 1
gives you a wooden sword that does 5 hearts of damage.

Also you determine how much xp gets taken off the player. /xp add @s -7 points
1
01/29/2020 5:20 pm
Level 1 : New Miner
jGaurd
Hey hobo I was wondering how you make a bread heal 3 hearts and grant 1 absorption heart? And how would I make to where u put 64 wheat in a furnace and get the bread
1
01/30/2020 3:07 am
Level 20 : Expert Unicorn
HoboMaggot
To get bread by putting 64 wheat in a furnace, you need to make your own recipe which you stuff into a datapack. I don't deal with custom recipes yet, so I can't help you with this.

Also with absorption, the minimum is 4 hearts
1
01/28/2020 5:12 am
Level 1 : New Network
OmegaPower6
how to make a scoreboard?
1
01/29/2020 4:20 am
Level 20 : Expert Unicorn
HoboMaggot
/scoreboard objectives add <criteria> <optional name>
Planet Minecraft Logo

Website

© 2010 - 2020
www.planetminecraft.com

Welcome