Skip to content

Commit

Permalink
v1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Owehttamy committed Sep 26, 2022
1 parent fb24038 commit e153f63
Show file tree
Hide file tree
Showing 12 changed files with 183 additions and 0 deletions.
2 changes: 2 additions & 0 deletions data/cave_cleaner/functions/load.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
scoreboard objectives add cave_cleaner trigger "Cave Cleaner"
scoreboard objectives add cave_glow trigger "Cave Cleaner Glow"
11 changes: 11 additions & 0 deletions data/cave_cleaner/functions/schedule.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
schedule function cave_cleaner:schedule 10t
execute as @a[gamemode=spectator,scores={cave_cleaner=1..}] at @s run function cave_cleaner:trigger_cave_cleaner
#execute as @a[gamemode=creative,scores={cave_cleaner=1..}] at @s run function cave_cleaner:trigger_cave_cleaner
scoreboard players enable @a[gamemode=spectator] cave_cleaner
#scoreboard players enable @a[gamemode=creative] cave_cleaner
scoreboard players set @a cave_cleaner 0
execute as @a[gamemode=spectator,scores={cave_glow=1..}] at @s run function cave_cleaner:trigger_cave_glow
#execute as @a[gamemode=creative,scores={cave_glow=1..}] at @s run function cave_cleaner:trigger_cave_glow
scoreboard players enable @a[gamemode=spectator] cave_glow
#scoreboard players enable @a[gamemode=creative] cave_glow
scoreboard players set @a cave_glow 0
12 changes: 12 additions & 0 deletions data/cave_cleaner/functions/trigger_cave_cleaner.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Looking to change the "cleaning" radius? Replace anything with ",distance..16]" to your desired number.
# Also suggested to change the number in the tellraw command too, but it's not necessary since it's just visual.
# Example:
# execute store result score @s cave_cleaner if entity @e[type=#cave_cleaner:unclean,predicate=cave_cleaner:unclean,distance=..64]
# execute as @e[type=#cave_cleaner:unclean,predicate=cave_cleaner:unclean,distance=..64] run data merge entity @s {Health:0.0f,DeathTime:19s}
# tellraw @s [{"text":"Cleaned ","color":"gold"},{"score":{"name":"@s","objective":"cave_cleaner"},"color":"gold"},{"text":" entities within 64 blocks","color":"gold"}]

execute store result score @s cave_cleaner if entity @e[type=#cave_cleaner:unclean,predicate=cave_cleaner:unclean,distance=..16]
execute as @e[type=#cave_cleaner:unclean,predicate=cave_cleaner:unclean,distance=..16] run data merge entity @s {Health:0.0f,DeathTime:19s}
tellraw @s [{"text":"Cleaned ","color":"gold"},{"score":{"name":"@s","objective":"cave_cleaner"},"color":"gold"},{"text":" entities within 16 blocks","color":"gold"}]

# Don't forget to save your changes, then restart the server/world for them to go into effect.
13 changes: 13 additions & 0 deletions data/cave_cleaner/functions/trigger_cave_glow.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Looking to change the glowing radius? Replace anything with ",distance..128]" to your desired number.
# Also suggested to change the number in the tellraw command too, but it's not necessary since it's just visual.
# Same situation with changing the duration of the glowing effect, except your replacing the "10". In the example, I changed it to 5 seconds.
# Example:
# execute store result score @s cave_glow if entity @e[type=#cave_cleaner:unclean,predicate=cave_cleaner:unclean,distance=..256]
# effect give @e[type=#cave_cleaner:unclean,predicate=cave_cleaner:unclean,distance=..256] minecraft:glowing 5
# tellraw @s [{"text":"Gave ","color":"gold"},{"score":{"name":"@s","objective":"cave_glow"},"color":"gold"},{"text":" entities within 256 blocks glowing for 5 seconds","color":"gold"}]

execute store result score @s cave_glow if entity @e[type=#cave_cleaner:unclean,predicate=cave_cleaner:unclean,distance=..128]
effect give @e[type=#cave_cleaner:unclean,predicate=cave_cleaner:unclean,distance=..128] minecraft:glowing 10
tellraw @s [{"text":"Gave ","color":"gold"},{"score":{"name":"@s","objective":"cave_glow"},"color":"gold"},{"text":" entities within 128 blocks glowing for 10 seconds","color":"gold"}]

# Don't forget to save your changes, then restart the server/world for them to go into effect.
11 changes: 11 additions & 0 deletions data/cave_cleaner/predicates/unclean.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"equipment": {
"mainhand": {
"tag": "cave_cleaner:unclean"
}
}
}
}
8 changes: 8 additions & 0 deletions data/cave_cleaner/tags/entity_types/unclean.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"values": [
"minecraft:drowned",
"minecraft:husk",
"minecraft:zombie",
"minecraft:zombie_villager"
]
}
48 changes: 48 additions & 0 deletions data/cave_cleaner/tags/items/unclean.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"values": [
"minecraft:amethyst_shard",
"minecraft:andesite",
"minecraft:arrow",
"minecraft:bamboo",
"minecraft:bone",
"minecraft:calcite",
"minecraft:carrot",
"minecraft:coarse_dirt",
"minecraft:cobbled_deepslate",
"minecraft:cobblestone",
"minecraft:cod",
"minecraft:deepslate",
"minecraft:diorite",
"minecraft:dirt",
"minecraft:egg",
"minecraft:glow_ink_sac",
"minecraft:granite",
"minecraft:gravel",
"minecraft:gunpowder",
"minecraft:ink_sac",
"minecraft:mud",
"minecraft:netherrack",
"minecraft:pointed_dripstone",
"minecraft:poisonous_potato",
"minecraft:potato",
"minecraft:rail",
"minecraft:raw_copper",
"minecraft:raw_gold",
"minecraft:raw_iron",
"minecraft:red_sand",
"minecraft:rooted_dirt",
"minecraft:rotten_flesh",
"minecraft:salmon",
"minecraft:sand",
"minecraft:sandstone",
"minecraft:slime_ball",
"minecraft:spider_eye",
"minecraft:stick",
"minecraft:stone",
"minecraft:string",
"minecraft:sugar_cane",
"minecraft:tropical_fish",
"minecraft:tuff",
"minecraft:wheat_seeds"
]
}
1 change: 1 addition & 0 deletions data/minecraft/tags/functions/load.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"replace":false,"values":["cave_cleaner:load","cave_cleaner:schedule"]}
36 changes: 36 additions & 0 deletions howToUse.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
All the information you'll need working with this datapack should be in here.
----------

HOW TO USE THE COMMANDS
/trigger cave_glow
- Gives persistent entities within 128 blocks glowing for 10 seconds
- Can only be triggered in spectator mode

/trigger cave_cleaner
- Kills persistent entities within 16 blocks
- Can only be triggered in spectator mode

----------

HOW TO CHANGE THE GLOWING RADIUS
Go to "Cave Cleaner/data/cave_cleaner/functions/trigger_cave_glow.mcfunction" and open the file.
The first few lines will explain what to do.

HOW TO CHANGE THE GLOWING DURATION
Go to "Cave Cleaner/data/cave_cleaner/functions/trigger_cave_glow.mcfunction" and open the file.
The first few lines will explain what to do.

HOW TO CHANGE THE "CLEANING" RADIUS
Go to "Cave Cleaner/data/cave_cleaner/functions/trigger_cave_cleaner.mcfunction" and open the file.
The first few lines will explain what to do.

HOW TO ENABLE CAVE CLEANER IN CREATIVE MODE
Go to "Cave Cleaner/data/cave_cleaner/functions/schedule.mcfunction" and open the file.
Remove every pound/hashtag symbol ("#") in the file.
Don't forget to save your changes, then restart the server/world for them to go into effect.

----------

Confused? Couldn't find what you were looking for? Still need help? Datapack needs updating to latest version? Send me a private message at:
Twitter - @Owehttamy
Discord - @Owehttamy#0001
6 changes: 6 additions & 0 deletions pack.mcmeta
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"pack": {
"pack_format": 10,
"description": "§6Cave Cleaner\n§eUnofficial Public Version"
}
}
Binary file added pack.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions readMe.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
This data pack is used to kill any persistent or "unclean" zombies that have picked up items and now won't despawn.
This is done by using the "/trigger cave_glow" and "/trigger cave_cleaner" commands in spectator mode.
Want to see it in action? Check out Xisumavoid's video on the pack and how it's used: https://youtu.be/NpOszQWKC8s?t=119

This datapack was originally created by Grant from the Vanilla Tweaks team and was used on the Hermitcraft Season 8 world.
BUT, this is an unofficial—and therefore unsupported—version of the datapack, as I have modified the files to update and improve the pack to the latest version.

If you would like to download the official (and outdated) version of the cave cleaner datapack, you will find it in the datapacks folder here:
https://download.hermitcraft.com/hermitcraft8.zip

Why isn't there an official version of the Cave Cleaner datapack?
Quote from Grant: "A lot of people would want to configure it (like by changing the items, radius, etc), and I don't like requiring people to go into the data for basic configuration.
Since that isn't very user-friendly, and we wouldn't want to be obligated to give lots of people support for going into the files to configure it either, or have to write FAQs for it."

Could it not be done through an options menu?
Grant: "Not really, since it's based on tags. Those can only be modified using JSON, not commands.
We could, hypothetically, implement something that is based on commands but it would be really messy and/or inefficient."
(Clearly he decided it was not in his best interest)



Thanks to Grant from the Vanilla Tweaks team for creating the original datapack and pointing me to where I could find the files. You can find some of his other work here:
https://vanillatweaks.net/

*** PLEASE DO NOT CONTACT GRANT OR ANYONE FROM VANILLA TWEAKS ASKING FOR SUPPORT REGARDING THIS DATAPACK ***

I have no affiliation with Hermitcraft or Vanilla Tweaks, and likely never will. I am providing this tool as a public resource so the player base can keep their worlds and servers lag-free.
If any members of Vanilla Tweaks or Hermitcraft have issues with this pack, please contact me at one of my socials referenced below. Thank you.

I, Owehttamy, am the one unofficially maintaining this server tool. If you have any questions, suggestions, need any help, or just wanna check out other stuff I do you can find me here:
Twitch: https://twitch.tv/owehttamy
Discord: @Owehttamy#0001
Twitter: @Owehttamy

Alright, have a nice day! (And thank you for reading this)

0 comments on commit e153f63

Please sign in to comment.