No Withdraw Command
TechPro424 opened this issue ยท 19 comments
You can use the /(alias) set command to both add and take away hearts as it should accept negative number
How do I make it so that players can only withdraw their own hearts and not others' hearts? Because I see only 1 permission, lifesteal.modify
to modify hearts.
Also, when the command is run, how do I get the heart to appear as an item in the inventory?
Yes
1 item = 1 heart of health, the item can be right clicked to add the heart to the player
You could always add a custom recipe to do this since there are requirements to cost hearts, plus this would give you alot of control over the withdrawal.
You can use the loosehealth
result to take health from a player (in half hearts), if we apply this and set it to two then it will cost a heart to craft, and the Item can have the mark lifesteal
to make it give a heart once consumed
Heres a demo one that costs 1 apple and gives the default craftable health item
{
"id": "lifesteal:healthwithdraw",
"recipe": {
"type": "minecraft:shapeless_crafting",
"group": "minecraft_apple",
"icon": {
"id": "minecraft:apple",
"Count": 1,
"tag": {
"Marks": [
"lifesteal"
],
"display": {
"Name": "{\"text\":\"Health\"}"
}
}
},
"requirements": {
},
"results": {
"loosehealth": 2
},
"ingredients": [
"minecraft:apple"
]
}
}
If you are okay with this then you can close the issue, however if you want a different solution just follow up with how you want said solution to work <3
So when the command is executed, it removes the player's hearts, automatically crafts that item, and gives the item to them?
If yes, how do I make it so that the item can be right clicked to apply the heart back?
No, there is no command that gives a player a heart. However you can utilise the recipe above to allow users to 'infuse' life into an item. Remember that any item that contains the mark "lifesteal" (or what ever you configured it to be) will give hearts when consumed.
So if I use this command, the item is infused with hearts, and can give back the hearts when consumed, right?
The recipe I provided will have be be crafted in a crafting table to achieve the effect you stated prior
The crafting recipe will do that yes
Do you mean we have to craft the item in a crafting table to achieve the effect?
Or will running the command be enough?
And a crafting one?
Crafting is already present
We do still need withdraw command tho
You could always add a custom recipe to do this since there are requirements to cost hearts, plus this would give you alot of control over the withdrawal.
You can use the
loosehealth
result to take health from a player (in half hearts), if we apply this and set it to two then it will cost a heart to craft, and the Item can have the marklifesteal
to make it give a heart once consumedHeres a demo one that costs 1 apple and gives the default craftable health item
{ "id": "lifesteal:healthwithdraw", "recipe": { "type": "minecraft:shapeless_crafting", "group": "minecraft_apple", "icon": { "id": "minecraft:apple", "Count": 1, "tag": { "Marks": [ "lifesteal" ], "display": { "Name": "{\"text\":\"Health\"}" } } }, "requirements": { }, "results": { "loosehealth": 2 }, "ingredients": [ "minecraft:apple" ] } }If you are okay with this then you can close the issue, however if you want a different solution just follow up with how you want said solution to work <3
how do I change the recipe? like, if I want multiple of one item in there, or if I want shaped crafting.