LifeSteal

LifeSteal

49.3k Downloads

LifeSteal

A simple fabric mod based on the LifeSteal SMP

This mod is dependent on BFAPI

Commands

This mod adds a command that can be used to modify and get a players lost health, the general structure is as follows:

/alias [get [uuid/name]]/[set [uuid/name] value]

This allows for moderation of players health without lengthy server restarts

Config

The config is found under lifesteal.json in the config directory

The default configuration looks like so:

{
    "comment-maxHealth": "The maximum *total* health that can be gained, if less than 0 it will be ignored",
    "maxHealth": -1.0,
    "comment-minHealth": "The minimum *total* health that someone can be at, when this value is reached they cannot be used to gain hearts",
    "minHealth": 0.0,
    "comment-healthToLooseOnDeath": "The amount of health to be lost when a player dies",
    "healthToLooseOnDeath": 2.0,
    "comment-looseHealthOnlyOnPlayerRelatedDeath": "This toggle dictates if a player can loose health from deaths that are not caused by a player, if true then they cannot",
    "looseHealthOnlyOnPlayerRelatedDeath": false,
    "punishment": {
        "banWhenHealthReachesZero": true,
        "banReason": {
            "text": "You have been banned due to your health reaching 0!"
        }
    },
    "comment-notEnoughHeartsMessage": "The message that is displayed when you kill a player that doesn't have enough hearts to kill you",
    "notEnoughHeartsMessage": {
        "text": "The player did not have any hearts you could steal"
        },
    "command": {
        "comment-enableCommands": "If the commands should be registered",
        "enableCommands": true,
        "comment-aliases": "The aliases that the command will register under",
        "aliases": [
            "lifesteal",
            "ls"
        ],
        "comment-permission": "The permission required to modify a players health *if you dont have a permission db the level can be set to the wanted operator level*",
        "permission": {
            "node": "lifesteal.modify",
            "level": "op_3"
        },
        "comment-successMessage": "The text sent to the player when they set another players health",
        "successMessage": {
            "color": "green",
            "text": "Done!"
        },
        "comment-successMessageFile": "The text sent to the player when they set another players health but they are not online so it stored it to be applied when the player joins",
        "successMessageFile": {
            "color": "green",
            "text": "Done! (to file)"
        },
        "comment-broadcastToOps": "If setting a players health should be broadcasted to all operators",
        "broadcastToOps": true
    },
    "recipe": {
        "comment-allowCraftingOfHealth": "If the default recipe should be registered if a custom one is not found under lifesteal:health",
        "allowCraftingOfHealth": true,
        "comment-registerRequirements": "Don't disable this unless you have a conflicting error, other mods recipes may depend on it",
        "registerRequirements": true,
        "comment-registerResults": "Don't disable this unless you have a conflicting error, other mods recipes may depend on it",
        "registerResults": true
    },
    "marks": {
        "comment-enableMarks": "If marks should be listened to, this is needed for health items",
        "enableMarks": true,
        "comment-marks": "The list of marks that will be listened to, if you remove/modify any of these ensure you update the crafting recipes mark",
        "marks": [
            "lifesteal",
            "health"
        ],
        "comment-limiter": "The maximum number of times a player can consume health before they are stopped, if less than 1 this is ignored",
        "limiter": -1,
        "output": {
            "comment-markOutputSuccess": "Sent to an entity when they consume a marked item sucessfully",
            "markOutputSuccess": {
                "text": "You consumed some health"
            },
            "comment-markOutputFailed": "Sent to an entity when they fail consume a marked item due to failing the limiter check",
            "markOutputFailed": {
                "color": "red",
                "text": "You have already consumed your fill of health"
            },
            "comment-broadcastToOpsMarks": "If operators should be told when a player consumes a marked item",
            "broadcastToOps": true
        }
    }
}

Links

API usage

API usage and documentation can bound found here