BradBot1 / LifeSteal

A fabric mod that implements a customisable version of the LifeSteal SMP
Apache License 2.0
2 stars 8 forks source link

No Withdraw Command #8

Open TechPro424 opened 2 years ago

TechPro424 commented 2 years ago

there is no /withdraw command to withdraw hearts

BradBot1 commented 2 years ago

You can use the /(alias) set command to both add and take away hearts as it should accept negative number

TechPro424 commented 2 years ago

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?

BradBot1 commented 2 years ago

Do you mean convert a players health into an item?

TechPro424 commented 2 years ago

Yes 1 item = 1 heart of health, the item can be right clicked to add the heart to the player

BradBot1 commented 2 years ago

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

TechPro424 commented 2 years ago

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?

BradBot1 commented 2 years ago

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.

TechPro424 commented 2 years ago

So if I use this command, the item is infused with hearts, and can give back the hearts when consumed, right?

BradBot1 commented 2 years ago

The crafting recipe will do that yes

TechPro424 commented 2 years ago

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?

BradBot1 commented 2 years ago

The recipe I provided will have be be crafted in a crafting table to achieve the effect you stated prior

TechPro424 commented 2 years ago

Is there any way to have it done using a command, without the crafing table?

BradBot1 commented 2 years ago

Not without curating a mod

TechPro424 commented 2 years ago

Would it be possible for you to add this feature? (Take your time)

ggdude01 commented 2 years ago

Can you please add a withdraw feature?

ggdude01 commented 2 years ago

And a crafting one?

TechPro424 commented 2 years ago

And a crafting one?

Crafting is already present We do still need withdraw command tho

MonkeMaps commented 2 years ago

how do you craft a heart than

MonkeMaps commented 2 years ago

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

how do I change the recipe? like, if I want multiple of one item in there, or if I want shaped crafting.