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.
7
These both require the use of scoreboards.
The sword: Make a scoreboard that detects use durability while holding the sword. So
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
When the food is eaten, give regen to the player who ate it, and reset.
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_beefWhen the food is eaten, give regen to the player who ate it, and reset.
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
You need to make an actual item for that, using attributes. So something like:
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
give @p minecraft:wooden_sword{AttributeModifiers:[{AttributeName:"generic.attackDamage",Name:"generic.attackDamage",Amount:10,Operation:0,UUIDLeast:349195,UUIDMost:244839}]} 1gives 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
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
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
Also with absorption, the minimum is 4 hearts
how to make a scoreboard?
/scoreboard objectives add <criteria> <optional name>
