forked from MinervaMc/Datapacks
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add helpers / update disable_mobs, fast_despawn and scoreboards
- Loading branch information
1 parent
92340b4
commit a5a89ad
Showing
12 changed files
with
310 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.idea | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
scoreboard objectives add disabledMobs dummy | ||
scoreboard objectives add .DisableMob trigger | ||
|
||
execute unless score #ONE disabledMobs matches 1 run scoreboard players set Bat disabledMobs 0 | ||
execute unless score #ONE disabledMobs matches 1 run scoreboard players set Fish disabledMobs 1 | ||
execute unless score #ONE disabledMobs matches 1 run scoreboard players set Guardian disabledMobs 0 | ||
execute unless score #INITIALIZED disabledMobs matches 1 run scoreboard players set Bat disabledMobs 0 | ||
execute unless score #INITIALIZED disabledMobs matches 1 run scoreboard players set Fish disabledMobs 1 | ||
execute unless score #INITIALIZED disabledMobs matches 1 run scoreboard players set Guardian disabledMobs 0 | ||
|
||
scoreboard players set #ONE disabledMobs 1 | ||
scoreboard players set #INITIALIZED disabledMobs 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 10 additions & 10 deletions
20
fast_despawn/data/fast_despawn/functions/install.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
scoreboard objectives add despawnItems dummy | ||
scoreboard objectives add .DespawnItems trigger | ||
|
||
execute unless score #ONE despawnItems matches 1 run scoreboard players set Kelp despawnItems 1 | ||
execute unless score #ONE despawnItems matches 1 run scoreboard players set Sand despawnItems 0 | ||
execute unless score #ONE despawnItems matches 1 run scoreboard players set Dirt despawnItems 0 | ||
execute unless score #ONE despawnItems matches 1 run scoreboard players set Stone despawnItems 0 | ||
execute unless score #ONE despawnItems matches 1 run scoreboard players set Grass despawnItems 0 | ||
execute unless score #ONE despawnItems matches 1 run scoreboard players set Gravel despawnItems 0 | ||
execute unless score #ONE despawnItems matches 1 run scoreboard players set EnderPearl despawnItems 1 | ||
execute unless score #ONE despawnItems matches 1 run scoreboard players set Netherrack despawnItems 0 | ||
execute unless score #ONE despawnItems matches 1 run scoreboard players set StoneVariants despawnItems 0 | ||
execute unless score #INITIALIZED despawnItems matches 1 run scoreboard players set Kelp despawnItems 1 | ||
execute unless score #INITIALIZED despawnItems matches 1 run scoreboard players set Sand despawnItems 0 | ||
execute unless score #INITIALIZED despawnItems matches 1 run scoreboard players set Dirt despawnItems 0 | ||
execute unless score #INITIALIZED despawnItems matches 1 run scoreboard players set Stone despawnItems 0 | ||
execute unless score #INITIALIZED despawnItems matches 1 run scoreboard players set Grass despawnItems 0 | ||
execute unless score #INITIALIZED despawnItems matches 1 run scoreboard players set Gravel despawnItems 0 | ||
execute unless score #INITIALIZED despawnItems matches 1 run scoreboard players set EnderPearl despawnItems 1 | ||
execute unless score #INITIALIZED despawnItems matches 1 run scoreboard players set Netherrack despawnItems 0 | ||
execute unless score #INITIALIZED despawnItems matches 1 run scoreboard players set StoneVariants despawnItems 0 | ||
|
||
scoreboard players set #ONE despawnItems 1 | ||
scoreboard players set #INITIALIZED despawnItems 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
|
||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous"> | ||
|
||
<title>Generate Scoreboard Datapack Files</title> | ||
</head> | ||
<body> | ||
<h2 class="text-center mt-3">File Contents for Scoreboards Datapack</h1> | ||
|
||
<div class="container"> | ||
<p class="text-center mt-2 mb-2"><world>/datapacks/scoreboards/data/scoreboards/functions/setup_scoreboards.mcfunction</p> | ||
<textarea class="form-control mb-3" id="objectiveCommands" cols="30" rows="10"></textarea> | ||
|
||
<p class="text-center mt-2 mb-2"><world>/datapacks/scoreboards/data/scoreboards/functions/setup_triggers.mcfunction</p> | ||
<textarea class="form-control mb-3" id="triggerCommands" cols="30" rows="10"></textarea> | ||
|
||
<p class="text-center mt-2 mb-2"><world>/datapacks/scoreboards/data/scoreboards/functions/check_triggers.mcfunction</p> | ||
<textarea class="form-control mb-3" id="checkTrigger" cols="30" rows="10"></textarea> | ||
</div> | ||
|
||
<script> | ||
let objectiveCommands = document.querySelector('#objectiveCommands'); | ||
let triggerCommands = document.querySelector('#triggerCommands'); | ||
let checkTrigger = document.querySelector('#checkTrigger'); | ||
|
||
let colors = [ 'dark_blue', 'dark_green', 'dark_aqua', 'dark_red', 'dark_purple', 'gold', 'gray', 'dark_gray', 'blue', 'green', 'aqua', 'red', 'light_purple', 'yellow', 'white', 'black', ]; | ||
|
||
async function main() { | ||
let res = await fetch('./scoreboards.json'); | ||
let json = await res.json(); | ||
|
||
let addObjectiveCommands = json.map(obj => [ | ||
'scoreboard objectives add', | ||
obj.name, | ||
obj.type, | ||
obj.display ? `"${obj.display}"` : '', | ||
].join(' ').trim()); | ||
|
||
objectiveCommands.innerHTML = addObjectiveCommands.join('\n'); | ||
|
||
let addTriggerCommands = json.map(obj => [ | ||
'scoreboard objectives add', | ||
`.${obj.name}`, | ||
'trigger' | ||
].join(' ').trim()); | ||
|
||
triggerCommands.innerHTML = addTriggerCommands.join('\n'); | ||
|
||
let checkTriggerCommands = json.map(obj => [ | ||
`execute if entity @a[scores={.${obj.name}=1..}] run scoreboard objectives setdisplay sidebar`, | ||
obj.name | ||
].join(' ').trim()); | ||
|
||
checkTriggerCommands.push(''); | ||
|
||
checkTriggerCommands.push('execute if entity @a[scores={.clear=1..}] run scoreboard objectives setdisplay sidebar'); | ||
|
||
checkTriggerCommands.push(...(colors.map((color, i) => [ | ||
`execute if entity @a[scores={.color=${i + 1}}] run team modify default color`, | ||
color | ||
].join(' ').trim()))); | ||
|
||
checkTriggerCommands.push(''); | ||
|
||
checkTriggerCommands.push(...(json.map(obj => [ | ||
`scoreboard players reset @a`, | ||
`.${obj.name}`, | ||
].join(' ').trim()))); | ||
|
||
checkTriggerCommands.push('scoreboard players reset @a .clear', 'scoreboard players reset @a .color', ''); | ||
|
||
checkTriggerCommands.push(...(json.map(obj => [ | ||
`scoreboard players enable @a`, | ||
`.${obj.name}`, | ||
].join(' ').trim()))); | ||
|
||
checkTriggerCommands.push('scoreboard players enable @a .clear', 'scoreboard players enable @a .color'); | ||
|
||
checkTrigger.innerHTML = checkTriggerCommands.join('\n'); | ||
} | ||
|
||
main(); | ||
</script> | ||
|
||
<style> | ||
textarea { | ||
resize: vertical; | ||
} | ||
</style> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
[ | ||
{ "name": "HoesPimpedOut", "type": "minecraft.used:minecraft.diamond_hoe" }, | ||
{ "name": "PickaxeDeaths", "type": "minecraft.broken:minecraft.diamond_pickaxe" }, | ||
{ "name": "Teleportations", "type": "minecraft.used:minecraft.ender_pearl" }, | ||
{ "name": "Mealtime", "type": "food" }, | ||
{ "name": "NetherSmashed", "type": "minecraft.mined:minecraft.netherrack" }, | ||
{ "name": "Boom", "type": "minecraft.used:minecraft.tnt" }, | ||
{ "name": "DealsMade", "type": "minecraft.custom:minecraft.traded_with_villager" }, | ||
{ "name": "DirtDug", "type": "minecraft.mined:minecraft.dirt" }, | ||
{ "name": "MoutonsTondus", "type": "minecraft.used:minecraft.shears" }, | ||
{ "name": "HoppersMade", "type": "minecraft.crafted:minecraft.hopper" }, | ||
{ "name": "AxeUser", "type": "minecraft.used:minecraft.diamond_axe" }, | ||
{ "name": "SandalsJamaica", "type": "minecraft.mined:minecraft.sand" }, | ||
{ "name": "IcePicked", "type": "minecraft.mined:minecraft.ice" }, | ||
{ "name": "Experience", "type": "xp" }, | ||
{ "name": "ShulkersShulked", "type": "minecraft.killed:shulker" }, | ||
{ "name": "SlimeBlocked", "type": "minecraft.crafted:minecraft.slime_block" }, | ||
{ "name": "GoldRush", "type": "minecraft.mined:minecraft.gold_ore" }, | ||
{ "name": "QuartzCompYipee", "type": "minecraft.mined:minecraft.nether_quartz_ore" }, | ||
{ "name": "MelonBros", "type": "minecraft.used:minecraft.melon" }, | ||
{ "name": "IronMade", "type": "minecraft.crafted:minecraft.iron_block" }, | ||
{ "name": "FishesHooked", "type": "minecraft.custom:minecraft.fish_caught" }, | ||
{ "name": "StoneCrushed", "type": "minecraft.mined:minecraft.stone" }, | ||
{ "name": "QuartzSMASHED", "type": "minecraft.mined:minecraft.nether_quartz_ore" }, | ||
{ "name": "Deaths", "type": "minecraft.custom:minecraft.deaths" }, | ||
{ "name": "Flighttime", "type": "minecraft.custom:minecraft.aviate_one_cm" }, | ||
{ "name": "NotGingers", "type": "minecraft.mined:minecraft.soul_sand" }, | ||
{ "name": "SoilCollected", "type": "minecraft.mined:minecraft.dirt" }, | ||
{ "name": "Run", "type": "minecraft.custom:minecraft.sprint_one_cm" }, | ||
{ "name": "BitchesSmacked", "type": "minecraft.custom:minecraft.damage_dealt" }, | ||
{ "name": "ClayWithMe", "type": "minecraft.mined:minecraft.clay" }, | ||
{ "name": "GlowstoneBlocked", "type": "minecraft.crafted:minecraft.glowstone" }, | ||
{ "name": "PickaxeUser", "type": "minecraft.used:minecraft.diamond_pickaxe" }, | ||
{ "name": "SkellyBellies", "type": "minecraft.killed:skeleton" }, | ||
{ "name": "RedOreMined", "type": "minecraft.mined:minecraft.redstone_ore" }, | ||
{ "name": "MelonsBro", "type": "minecraft.crafted:minecraft.melon" }, | ||
{ "name": "ButtonsMade", "type": "minecraft.crafted:minecraft.stone_button" }, | ||
{ "name": "CoalMiner", "type": "minecraft.mined:minecraft.coal_ore" }, | ||
{ "name": "ChestsPeakedAt", "type": "minecraft.custom:minecraft.open_chest" }, | ||
{ "name": "WinnerWinner", "type": "minecraft.used:minecraft.cooked_chicken" }, | ||
{ "name": "RedstoneDustUsed", "type": "minecraft.used:minecraft.redstone" }, | ||
{ "name": "CapsPopped", "type": "minecraft.used:minecraft.firework_rocket" }, | ||
{ "name": "BucketsFilled", "type": "minecraft.used:minecraft.bucket" }, | ||
{ "name": "Hearts", "type": "health" }, | ||
{ "name": "BigSkeletons", "type": "minecraft.killed:wither_skeleton" }, | ||
{ "name": "TimePlayed", "type": "minecraft.custom:minecraft.play_one_minute" }, | ||
{ "name": "Pubish", "type": "minecraft.mined:minecraft.dead_bush" }, | ||
{ "name": "BombsMade", "type": "minecraft.crafted:minecraft.tnt" }, | ||
{ "name": "RaceForTheCure", "type": "minecraft.custom:minecraft.walk_one_cm" }, | ||
{ "name": "GhastsTagged", "type": "minecraft.killed:ghast" }, | ||
{ "name": "LivesEnded", "type": "minecraft.custom:minecraft.mob_kills" }, | ||
{ "name": "Leaps", "type": "minecraft.custom:minecraft.jump" }, | ||
{ "name": "DragonEggsLaid", "type": "minecraft.used:minecraft.dragon_egg" }, | ||
{ "name": "DealsGoneBad", "type": "minecraft.killed:villager" }, | ||
{ "name": "SnowFortsMade", "type": "minecraft.crafted:minecraft.snow" }, | ||
{ "name": "Walk", "type": "minecraft.custom:minecraft.walk_one_cm" }, | ||
{ "name": "RodUses", "type": "minecraft.used:minecraft.fishing_rod" }, | ||
{ "name": "SeaLightsMade", "type": "minecraft.crafted:minecraft.sea_lantern" }, | ||
{ "name": "RAGEquits", "type": "minecraft.custom:minecraft.leave_game" }, | ||
{ "name": "SeaLightsPlaced", "type": "minecraft.used:minecraft.sea_lantern" }, | ||
{ "name": "DIAMONDS", "type": "minecraft.mined:minecraft.diamond_ore", "display": "DIAMONDS!!!" }, | ||
{ "name": "RedstoneBlocked", "type": "minecraft.crafted:minecraft.redstone_block" }, | ||
{ "name": "IronPlaced", "type": "minecraft.used:minecraft.iron_block" }, | ||
{ "name": "PistonsMade", "type": "minecraft.crafted:minecraft.piston" }, | ||
{ "name": "TntPlaced", "type": "minecraft.used:minecraft.tnt" }, | ||
{ "name": "EmerladsPicked", "type": "minecraft.mined:minecraft.emerald_ore" }, | ||
{ "name": "SnowBallsMade", "type": "minecraft.mined:minecraft.snow" }, | ||
{ "name": "GoldenPigged", "type": "minecraft.killed:minecraft.zombified_piglin" }, | ||
{ "name": "SteakDinners", "type": "minecraft.used:minecraft.cooked_beef" }, | ||
{ "name": "HardcoreClayers", "type": "minecraft.mined:minecraft.terracotta" }, | ||
{ "name": "BlueOreMined", "type": "minecraft.mined:minecraft.lapis_ore" }, | ||
{ "name": "IronGrabbed", "type": "minecraft.picked_up:minecraft.iron_ingot" }, | ||
{ "name": "Lifetime", "type": "minecraft.custom:minecraft.time_since_death" }, | ||
{ "name": "animalBabysMade", "type": "minecraft.custom:minecraft.animals_bred" }, | ||
{ "name": "SwordSwings", "type": "minecraft.used:minecraft.diamond_sword" }, | ||
{ "name": "ShovelUser", "type": "minecraft.used:minecraft.diamond_shovel" }, | ||
{ "name": "HardestStone", "type": "minecraft.broken:minecraft.obsidian" }, | ||
{ "name": "IcePacked", "type": "minecraft.broken:minecraft.packed_ice" }, | ||
{ "name": "honeyBlocked", "type": "minecraft.crafted:minecraft.honey_block" }, | ||
{ "name": "DeepBlue", "type": "minecraft.crafted:minecraft.blue_ice" }, | ||
{ "name": "PackedIce", "type": "minecraft.crafted:minecraft.packed_ice" }, | ||
{ "name": "BlueIcePunch", "type": "minecraft.broken:minecraft.blue_ice" }, | ||
{ "name": "CombsMade", "type": "minecraft.crafted:minecraft.honeycomb_block" }, | ||
{ "name": "stingersRemoved", "type": "minecraft.killed:minecraft.bee" }, | ||
{ "name": "DeadMenChested", "type": "minecraft.killed:minecraft.drowned" }, | ||
{ "name": "NetheriteMined", "type": "minecraft.mined:minecraft.ancient_debris" } | ||
] |
Oops, something went wrong.