Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add undead players and animi shamir compatibility #935

Merged
merged 3 commits into from
Jan 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions gm4_animi_shamir/beet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ data_pack:

pipeline:
- gm4.plugins.extend.module
- gm4.plugins.include.lib_player_death

meta:
gm4:
versioning:
required:
gm4_metallurgy: 1.2.0
lib_player_death: 1.0.0
schedule_loops: [main]
website:
description: Adds the Animi Shamir to Metallurgy. Items with Animi will respawn with you when you die!
Expand Down
34 changes: 0 additions & 34 deletions gm4_animi_shamir/data/gm4_animi_shamir/advancements/death.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
"condition": "minecraft:entity_scores",
"entity": "this",
"scores": {
"gm4_animi_leave": 1
"gm4_animi_leave": {
"min": 1
}
}
}
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @s = player who has died
# at @s
# run from gm4_animi_shamir:death advancement
# run from #gm4_player_death:soul_bound

# compile item list
data remove storage gm4_animi_shamir:cache prepared_entry
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": [
"gm4_animi_shamir:player/upon_death"
]
}
3 changes: 3 additions & 0 deletions gm4_undead_players/beet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ data_pack:

pipeline:
- gm4.plugins.extend.module
- gm4.plugins.include.lib_player_death

meta:
gm4:
versioning:
required:
lib_player_death: 1.0.0
schedule_loops: [main]
website:
description: You'll find your death point faster, but you'll have to fight your corpse for your stuff back!
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": [
"gm4_undead_players:died"
]
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
#run from gm4_undead_players:death advancement
#run from #gm4_player_death:grave
#@s = player who took fatal damage

# Reset death tracking scoreboard and advancement to allow for the player to die again.
advancement revoke @s only gm4_undead_players:death
scoreboard players reset @s gm4_undead

# Summon undead player unless player has ignore tag or is in creative/spectator.
execute if entity @s[tag=!gm4_undead_ignore,gamemode=!creative,gamemode=!spectator] run function gm4_undead_players:summon_zombie
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# Add death tracking scoreboard and reset in case player died while module was disabled.
scoreboard objectives add gm4_undead minecraft.custom:minecraft.deaths
scoreboard players reset * gm4_undead

# Add scoreboard used to implement custom logic for undead player drowned conversion.
scoreboard objectives add gm4_undead_drown dummy

Expand Down
21 changes: 21 additions & 0 deletions lib_player_death/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Gamemode 4 Development

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
1 change: 1 addition & 0 deletions lib_player_death/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# lib_player_death
20 changes: 20 additions & 0 deletions lib_player_death/beet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
id: gm4_player_death
name: Gamemode 4 Player Death
version: 1.0.X

data_pack:
load:
data: data

pipeline:
- gm4.plugins.extend.library

meta:
gm4:
versioning:
extra_version_injections:
advancements:
- death
credits:
Creator:
- Misode
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
{
"criteria": {
"death": {
"die": {
"trigger": "minecraft:entity_hurt_player",
"conditions": {
"player": [
{
"condition": "minecraft:entity_scores",
"entity": "this",
"scores": {
"gm4_undead": 1
"gm4_player_death_count": {
"min": 1
}
}
}
]
}
}
},
"rewards": {
"function": "gm4_undead_players:died"
"function": "gm4_player_death:death"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# @s = player that just died
# run from advancement player_death

advancement revoke @s only gm4_player_death:death
scoreboard players reset @s gm4_player_death_count

function #gm4_player_death:_private/death
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Add death tracking and reset objective in case the player died while the data pack was disabled
scoreboard objectives add gm4_player_death_count deathCount
scoreboard objectives reset * gm4_player_death_count
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"values": [
{
"id": "#gm4_player_death:soul_bound",
"required": false
},
{
"id": "#gm4_player_death:relocate",
"required": false
},
{
"id": "#gm4_player_death:grave",
"required": false
},
{
"id": "#gm4_player_death:death",
"required": false
}
]
}
Loading