-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Spawners reset on_game_load now have their delay randomizes between 1…
…-40s (Noxitu's math)
- Loading branch information
1 parent
19d68e0
commit 9950b36
Showing
3 changed files
with
39 additions
and
6 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
Brilliance Datapack/data/do2/functions/reset_dungeon/reset_single_spawner.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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Generate a random #(1-25) | ||
# If # < 10, set spawner's delay to # | ||
# If # >= 10, generate TWO #(10-40). | ||
# Save the lowest of those TWO # | ||
# With that new # set spawner's Delay to the # | ||
|
||
# Generate a number between 0-24 | ||
scoreboard players set $dungeon do2.utility.randomNumberRange 25 | ||
function do2:random_gen/generate_random_number | ||
# Add 1 so it's 1-25 | ||
scoreboard players add $dungeon do2.utility.randomNum | ||
execute store result storage do2:mobs spawner int 1 run scoreboard players get $dungeon do2.utility.randomNum | ||
# If it's < 10 set the delay to the number | ||
execute unless score $dungeon do2.utility.randomNum matches 10.. run data modify block ~ ~ ~ Delay set from storage do2:mobs spawner | ||
execute unless score $dungeon do2.utility.randomNum matches 10.. run return 0 | ||
|
||
# If it's > 10 | ||
scoreboard objectives add do2.tests.findSmallestNumber dummy | ||
# Generate a number between 0-30 | ||
scoreboard players set $dungeon do2.utility.randomNumberRange 31 | ||
function do2:random_gen/generate_random_number | ||
# Add 10 so it's 10-40 | ||
scoreboard players add $dungeon do2.utility.randomNum 10 | ||
# Store the number | ||
execute store result score $dungeon do2.tests.findSmallestNumber run scoreboard players get $dungeon do2.utility.randomNum | ||
# Do it all again | ||
function do2:random_gen/generate_random_number | ||
scoreboard players add $dungeon do2.utility.randomNum 10 | ||
# Compare sizes. | ||
execute unless score $dungeon do2.tests.findSmallestNumber < $dungeon do2.utility.randomNum store result score $dungeon do2.tests.findSmallestNumber run scoreboard players get $dungeon do2.utility.randomNum | ||
execute store result storage do2:mobs spawner int 1 run scoreboard players get $dungeon do2.tests.findSmallestNumber | ||
data modify block ~ ~ ~ Delay set from storage do2:mobs spawner | ||
scoreboard objectives remove do2.tests.findSmallestNumber | ||
|
7 changes: 3 additions & 4 deletions
7
Brilliance Datapack/data/do2/functions/reset_dungeon/reset_spawners.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,4 +1,3 @@ | ||
|
||
data modify block -487 34 1981 Delay set value -1s | ||
data modify block -485 38 1964 Delay set value -1s | ||
data modify block -500 35 1977 Delay set value -1s | ||
execute positioned -487 34 1981 run function do2:reset_dungeon/reset_single_spawner | ||
execute positioned -485 38 1964 run function do2:reset_dungeon/reset_single_spawner | ||
execute positioned -500 35 1977 run function do2:reset_dungeon/reset_single_spawner |
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,3 +1,3 @@ | ||
# DATAPACK VERSION NUMBER: 0.13.12 | ||
# DATAPACK VERSION NUMBER: 0.13.14 | ||
|
||
tellraw @s ["",{"text":"The §o§n§aBrilliance Datapack§r's version is: [§b0.13.12§r] Check latest version "},{"text":"§o§b§nhere§r","clickEvent":{"action":"open_url","value":"https://github.com/trackedout/Brilliance/blob/main/Brilliance%20Datapack/data/do2/functions/version.mcfunction"}},{"text":"."}] | ||
tellraw @s ["",{"text":"The §o§n§aBrilliance Datapack§r's version is: [§b0.13.14§r] Check latest version "},{"text":"§o§b§nhere§r","clickEvent":{"action":"open_url","value":"https://github.com/trackedout/Brilliance/blob/main/Brilliance%20Datapack/data/do2/functions/version.mcfunction"}},{"text":"."}] |