[1.16.5] functions somehow doesn't recognize gamestate command.
Darkmega18 opened this issue ยท 3 comments
I'm trying to get fancy. Because expert mode is faulty in my pack because of the last bug I reported which makes the world start in expert mode if I give the list of mobs to kill to trigger it anything other than default mobs.
So I made up my own thing using scoreboards, a lot of commands, ftbquests and functions. ... but here we go again:
I tried to add gamestate expert into my function that triggers a collection of effects and other things when the scores are right... but now it's telling me this:
[04:40:29] [Render thread/ERROR]: Failed to load function racesoforder:darknesstick
java.util.concurrent.CompletionException: java.lang.IllegalArgumentException: Whilst parsing command on line 1: Incorrect argument for command at position 106: ...hes 0 run <--[HERE]
at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273) ~[?:1.8.0_51]
at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280) ~[?:1.8.0_51]
at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1584) ~[?:1.8.0_51]
at java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1574) ~[?:1.8.0_51]
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) ~[?:1.8.0_51]
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) ~[?:1.8.0_51]
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1689) ~[?:1.8.0_51]
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157) ~[?:1.8.0_51]
the other catch, is that when I switched the gamestate command with a say command, it worked perfectly fine and all triggers immediately started working. of course, short of the whole entire reason I made the function to begin with, to customize the circumstances under which a worldstate occurs in the first place.
So, what could possibly have gone wrong that makes the game literally not know about your commands until I'm actually in the game?
execute if score TheWorld Darkness >= TheWorld DarknessElite if score TheWorld DarknessTier matches 0 run gamestate expert
execute if score TheWorld Darkness >= TheWorld DarknessElite if score TheWorld DarknessTier matches 0 run tellraw @a ["",{"text":"oof","bold":true,"obfuscated":true,"color":"#6600E5"},{"text":"A wave of fleeting","bold":true,"color":"#6600E5"},{"text":" ","bold":true,"color":"#6600E5","hoverEvent":{"action":"show_text","contents":{"text":"The World has entered Expert Mode.","italic":"true","color":"dark_red"}}},{"text":"dread","bold":true,"italic":true,"underlined":true,"color":"#6600E5","hoverEvent":{"action":"show_text","contents":{"text":"The World has entered Expert Mode.","italic":"true","color":"dark_red"}}},{"text":" ","bold":true,"color":"#6600E5","hoverEvent":{"action":"show_text","contents":{"text":"The World has entered Expert Mode.","italic":"true","color":"dark_red"}}},{"text":"shocks your mind as the shadows seem to close in around you...","bold":true,"color":"#6600E5"},{"text":"oof","bold":true,"obfuscated":true,"color":"#6600E5"}]
execute if score TheWorld Darkness >= TheWorld DarknessElite if score TheWorld DarknessTier matches 0 run effect give @a champions:paralysis 2 0
execute if score TheWorld Darkness >= TheWorld DarknessElite if score TheWorld DarknessTier matches 0 run effect give @a minecraft:blindness 8 0
execute if score TheWorld Darkness >= TheWorld DarknessElite if score TheWorld DarknessTier matches 0 run effect give @a minecraft:weakness 10 0
execute if score TheWorld Darkness >= TheWorld DarknessElite if score TheWorld DarknessTier matches 0 run effect give @a minecraft:slowness 20 0
execute if score TheWorld Darkness >= TheWorld DarknessElite if score TheWorld DarknessTier matches 0 run effect give @a minecraft:nausea 15 0
execute if score TheWorld Darkness >= TheWorld DarknessElite if score TheWorld DarknessTier matches 0 run playsound betterendforge:betterendforge.entity.shadow_walker player @a ~ ~ ~
execute if score TheWorld Darkness >= TheWorld DarknessElite if score TheWorld DarknessTier matches 0 run scoreboard players set TheWorld DarknessTier 1
execute if score TheWorld Darkness >= TheWorld DarknessMaster if score TheWorld DarknessTier matches 1 run gamestate master
execute if score TheWorld Darkness >= TheWorld DarknessMaster if score TheWorld DarknessTier matches 1 run tellraw @a ["",{"text":"oof","bold":true,"obfuscated":true,"color":"#6600E5"},{"text":"The screams of mobs are heard from all around. Then another wave of dread washes over you as the shadows grow sharp and","bold":true,"color":"#6600E5"},{"text":" try to lash out and consume you","bold":true,"color":"#6600E5","hoverEvent":{"action":"show_text","contents":{"text":"The World has entered Master Mode.","italic":"true","color":"dark_red"}}},{"text":". ","bold":true,"color":"#6600E5"},{"text":"oof","bold":true,"obfuscated":true,"color":"#6600E5"}]
execute if score TheWorld Darkness >= TheWorld DarknessMaster if score TheWorld DarknessTier matches 1 run effect give @a champions:paralysis 3 0
execute if score TheWorld Darkness >= TheWorld DarknessMaster if score TheWorld DarknessTier matches 1 run effect give @a minecraft:blindness 20 0
execute if score TheWorld Darkness >= TheWorld DarknessMaster if score TheWorld DarknessTier matches 1 run effect give @a minecraft:weakness 10 0
execute if score TheWorld Darkness >= TheWorld DarknessMaster if score TheWorld DarknessTier matches 1 run effect give @a minecraft:slowness 20 1
execute if score TheWorld Darkness >= TheWorld DarknessMaster if score TheWorld DarknessTier matches 1 run effect give @a tombstone:bait 60 0
execute if score TheWorld Darkness >= TheWorld DarknessMaster if score TheWorld DarknessTier matches 1 run effect give @a minecraft:nausea 30 0
execute if score TheWorld Darkness >= TheWorld DarknessMaster if score TheWorld DarknessTier matches 1 run playsound betterendforge:betterendforge.entity.shadow_walker player @a ~ ~ ~
execute if score TheWorld Darkness >= TheWorld DarknessMaster if score TheWorld DarknessTier matches 1 run playsound iceandfire:ghost_idle player @a ~ ~ ~
execute if score TheWorld Darkness >= TheWorld DarknessMaster if score TheWorld DarknessTier matches 1 run scoreboard players set TheWorld DarknessTier 2
execute if score TheWorld BorderCurrent = TheWorld BorderMax run execute as @s run execute as @a run resource set @s racesoforder:1_order_influence_darkness_tick_cooldown -3600
The function in question which is in my datapack. replace both gamestate commands with otherwise inconsequential say commands and it works just fine.
This is because /gamestate has a permission tier requirement of 4, which is beyond what is allowed of a function (2).