#Creating a death penalty datapack.

1 messages · Page 1 of 1 (latest)

outer peak
#

Hi helper,

First of all, my English skill is about 40%. I'm a beginner at datapack creation, and I somewhat understand how "scoreboard" works. I also know how to use the "effect" command for the most part, but I'm not very sure about the structure of a datapack.

My idea is: when a player dies, the max HP should be reduced by half for 30 minutes, and half of the items in their inventory (including armor slots and hotbar) should be destroyed.

Thanks every single helper there come to help.

For the purpose of use.
I'm using it for my personal Minecraft server, which I play with my four friends. It's just for fun, not for profit

edgy scaffoldBOT
#

<@&1201956957406109788>

Someone will come and help soon!

💬 While you wait, take this time to provide more context and details.

✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve

edgy scaffoldBOT
# edgy scaffold <@&1201956957406109788>

<@&1166082198152159386> <@&1202694677766348840>

🙇 Helpers Arise!

Please note that you still might not immediately get a response since all helpers are human beings and volunteers (and also might be sleeping right now)

solid peak
#

You can make a scoreboard that tracks player deaths with /scoreboard objectives add (name) Death (display name)

#

From there, you can make a datapack function which constantly checks if players have a "death" of more than 0 (1 or more), and if so, change their max health attribute to half

#

Then make another scoreboard as a timer (there are tutorials online for that) and once the timer hits 30 minutes, you can remove the attribute

#

The part about destroying half their items, I don't know how to do.

outer peak
#

Thanks for response
what structure of datapack. anything like that i have never knew it.

i can using hub helper bot to make it one, yes?

i'll try.

outer peak
# solid peak You can make a scoreboard that tracks player deaths with `/scoreboard objectives...

scoreboard

scoreboard objectives add diedCount deathCount
scoreboard objectives add effectTimer dummy

player

execute as @a[scores={diedCount=1..}] run function custom:apply_debuff

apply_debuff

set Max HP 40% set effectTimer = 36000 ticks (30 min)

function custom:apply_debuff {
attribute @a[scores={diedCount=1..}] minecraft:generic.max_health base set 12.0
scoreboard players set @a[scores={diedCount=1..}] effectTimer 36000
}

every 1 sec effectTimer decrease 20 ticks

execute as @a[scores={effectTimer=1..}] run scoreboard players remove @s effectTimer 20

reset effectTimer

execute as @a[scores={effectTimer=0}] run function custom:reset_status

function reset_status

function custom:reset_status {
attribute @a[scores={effectTimer=0}] minecraft:generic.max_health base set 20.0
scoreboard players set @a[scores={effectTimer=0}] diedCount 0
scoreboard players reset @a[scores={effectTimer=0}] effectTimer
}

solid peak
#

Basically I would just create a tick function that checks for players with a diedCount of 1 or more. If they have it, add "effectTimer" to 30 minutes (multiply 20 by 60 to get the amount of ticks in 1 minute, multiply that number by 30 to get ticks in 30 minutes)

#

Then, in the same tick function, run a scoreboard that removes 1 point of effectTimer for all players which would cause it to always count down

#

The next command in the function would be the one that gives players who have an effectTimer of 1 or more an attribute that reduces their max health

#

So all of this can be done in a single tick function, you don't need most of the stuff i think you wrote

#

This would maybe be... i don't know, 4 or 5 commands tops? Not including the ones that create the scoreboards

edgy scaffoldBOT
#
Closed for inactivity

This question has been inactive for some time, so it's going to be closed for inactivity. If you still need it, please disregard this message.

edgy scaffoldBOT
#
Closed for inactivity

This question has been inactive for some time, so it's going to be closed for inactivity. If you still need it, please disregard this message.

edgy scaffoldBOT
#
Closed for inactivity

This question has been inactive for some time, so it's going to be closed for inactivity. If you still need it, please disregard this message.