Jump to content
  • 0

Possible to have a 3 life system in Minehut?



8 answers to this question

Recommended Posts

  • 4

You can use a plugin called Skript to do this. First download the plugin called Skript and restart the server. Then go to plugins > skript > scripts. Then in this scripts folder, make a file called like lives.sk. It can be called anything but just has to end in .sk. Then in that file you just created, put this in it and click save.

on death of player:
	add 1 to {deaths::%victim's uuid%}

on respawn:
	if {deaths::%player's uuid%} >= 3:
		set player's gamemode to spectator

command /resetdeaths <player>:
  	permission: deaths.reset
  		set {deaths::%arg-1's uuid%} to 0
  		set arg-1's gamemode to survival

This makes it that whenever someone dies 3 times, they get put into spectator mode. Then someone with op or the permission node deaths.reset can do /resetdeaths <player> to reset a certain player's deaths and put them back in surival mode. After you put that inside of the file and clicked save, go in game and type /sk reload lives, or whatever you named the file. Now the skript should be working. Note that if it shows any indent errors cause of the forums formatting, try using the one from this pastebin. https://pastebin.com/7bEgzLGU


Note that this is also possible with just vanilla minecraft using command blocks, I'm just not sure how to use them. You can either find an online tutorial or someone else can show you if you want to do it with just command blocks. 

  • Like 1

Discord - tarna256

In-game name - _Tarna_

Website - https://tarna.dev
Paste Site: https://paste.tarna.dev


[VIP] - 7/27/2020

Community Support - 7/8/20 | 11/3/20

Helper  - 11/3/20 - 2/21/21

Moderator - 2/21/21 - 5/17/21

❤️ - 5/17/21 - now

Moderator - 12/20/22 - now



Link to comment
Share on other sites

  • 0

Thanks, the code worked! But there is an issue where, when spectators leave and join back to the game, their game mode is switched to survival. The death count for them isn't changed, just their game mode. I know I can just ban them, but I would like to give them the option to spectate. Can this be fixed?

Edited by maxybuild
Link to comment
Share on other sites

This topic is now closed to further replies.
  • Create New...