2

How to make Custom weapon

jGaurd 1/27/20 11:42 pm
728
1/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
jGaurd
Level 1 : New Miner
0

  Have something to say?

JoinSign in

7

HoboMaggot
01/28/2020 4:19 am
Level 56 : Grandmaster Blob
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.
2
jGaurd
01/28/2020 9:57 am
Level 1 : New Miner
history
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
HoboMaggot
01/29/2020 4:57 am
Level 56 : Grandmaster Blob
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
jGaurd
01/29/2020 5:20 pm
Level 1 : New Miner
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
HoboMaggot
01/30/2020 3:07 am
Level 56 : Grandmaster Blob
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
OmegaPower6
01/28/2020 5:12 am
Level 4 : Apprentice Warrior
how to make a scoreboard?
1
HoboMaggot
01/29/2020 4:20 am
Level 56 : Grandmaster Blob
/scoreboard objectives add <criteria> <optional name>
1

Welcome