• check_circle Functions
  • 16,660 views, 20 today
  • 1,551 downloads, 3 today
  • 31
  • 28
  • 20
Ferr avatar Ferr
Level 31 : Artisan Engineer
10
Datapack inspired by the youtube series X-Life.

Basic info:
You start with 1 heart and 10 lives, each time you die you lose a life (obviously) but gain 1 extra heart.

It is a 1.16+ datapack since it is only possible with the newly added attribute command.

Administrative commands:
Note: make sure the player you execute the command for is online.
1. Have you accidentally killed a player on your server? (e.g.: maybe you've tp-ed him to you, he fell and died)
you can now give his life back by simply runing the command:
/execute as <player_name> run function xlife:add_lifeThis will also recalculate the number of hears he/she should have and pop a message letting him/her know the mistake was corrected.
Note: if that was his last live you'll have to set him manually back to survival

2. Did one of the players on the server lost all his/her lives and wants to start over?
You can now use the command below to set him/her back to 1 heart and 10 lives.
/execute as <player_name> run function xlife:reset_hearts
Note: you will have to set him manually back to survival

3. Did you run by accident one of the commands above for the wrong player?
You can fix it by removing his lives using this command:
/execute as <player_name> run function xlife:remove_life

4. Not sure why anyone would want this... but just in case you want some of your players to use xlife, and some to play normally, you can selectively disable the pack functionality just for some players:
/execute as <player_name> run function xlife:disable



Disclaimer: I do not claim any author rights over this since it wasn't my idea, but rather inspired by the youtube series, I just made it possible in vanilla with datapacks instead of using mods or plugins.
Feel free to use and incorporate it in your projects.
CompatibilityMinecraft 1.16
toMinecraft 1.17
Tags

1 Update Logs

Update #1 : 10/04/2020 10:35:50 amOct 4th, 2020

- Added a title that shows after you respawn letting you know how many lives left you have and how much you've survived
- You will now also receive a book recording the time you've survived
- Added a couple of administrative commands:
-> execute as <player_name> run function xlife:add_life
-> execute as <player_name> run function xlife:remove_life
-> execute as <player_name> run function xlife:reset_hearts
-> execute as <player_name> run function xlife:disable

Create an account or sign in to comment.

1
04/22/2021 12:07 pm
Level 1 : New Miner
Dynvsty
Dynvsty avatar
is it possible to change the number of hearts/lives you start with? like you start with 2 hearts and 9 lives?
1
02/13/2021 2:20 pm
Level 1 : New Miner
Kvsmos
Kvsmos avatar
How do i get the life book? like a explanation on how you did it at least.
1
02/01/2021 6:55 am
Level 1 : New Miner
Benzxlol
Benzxlol avatar
Ferr please help, commands are working but the hearts stay 10, no matter what command i do
1
02/05/2021 1:43 pm
Level 31 : Artisan Engineer
Ferr
Ferr avatar
Well first make sure you're in the right minecraft version.. so 1.16 - 1.16.5, if you're in one of the snapshots for 1.17 it is possible there might be bugs there since those are snapshots...



And lastly from what i've noticed if you're in a single player world you will need to run the /reload command every time you start up the world otherwise none of the datapacks work which is strange, but i guess it's just the way it is
2
04/18/2021 7:57 am
Level 1 : New Miner
Benzxlol
Benzxlol avatar
thank you
2
10/02/2020 2:13 am
Level 49 : Master Dragonborn
krossy
krossy avatar
Boodlyneck included your datapack in his Modded One Block series.

www.curseforge.com/minecraft/modpacks/boodlynecks-modded-oneblock-forge
2
10/03/2020 10:36 am
Level 31 : Artisan Engineer
Ferr
Ferr avatar
Thanks, i am aware, his friend BobR0ssiter asked for my permision. I don't really claim any author rights over this since it was just inspired by the youtube series, so it wasn't my idea, i just made it work in a datapack.
3
09/27/2020 2:19 pm
Level 1 : New Miner
lolfeil
lolfeil avatar
how do i reset lives ???
and
if I go to survival when I am a spectator I am born with 1 heart or with all
1
10/03/2020 10:55 am
Level 31 : Artisan Engineer
Ferr
Ferr avatar
Thanks for the feedback, at the moment the only way to reset the lives is by setting 2 scoreboards:

1. /scoreboard players set <player-name> deaths 0

this keeps track of how many times a player has died (0 deaths = 1 heart, 1 deaths = 2 hearts, and so on)

2. /scoreboard players set <player-name> newdeath 1

this will just trigger the calculation and update process for the number of hearts.
1
08/22/2020 10:11 am
Level 11 : Journeyman Miner
minecraft modded maps
minecraft modded maps avatar
i love smalishbeans and ldshadowlady
Planet Minecraft

Website

© 2010 - 2021
www.planetminecraft.com

Welcome