The justification for not allowing /forceload to work within commands is that it must be restricted to the sever owners, as otherwise any "lesser" operator could bring a server to its knees very easily. ( Tweet from Dinnerbone: https://twitter.com/dinnerbone/status/1030108572447858688 )
As only server operators have access to tagging functions with minecraft:tick (eg, by installing datapacks), then allowing /forceload to be used in functions which are initiated via a minecraft:tick tag would allow server owners to attach logic to this command, without allowing it to be run by just anyone.
For example, create the function feedback:gameloop; tag that function with minecraft:tick, causing that function to run once per tick. within feedback:gameloop, have something like:
execute unless entity @e[tag=requiredByTheMap] run function feedback:somethingElse
within feedback:somethignElse, have something like:
forceload 0 0
execute unless entity @e[tag=requiredByTheMap] run summon minecraft:armor_stand 0 0 0 {Marker:1b, Tags:["requiredByTheMap"]}
So, once per tick, the game would run feedback:gameloop, and potentially feedback:somethingElse, and the forceload command within would work if applicable.
If an op runs /function feedback:gameloop then it would execute feedback:gameloop, and potentially feedback:somethingElse, but the forceload command within would do nothing / fail (current behaviour)
ie: the thing that allows /forceload to work is the fact that it is initiated by the minecraft:tick'ed function, specifically when it is initiated by the tick, not just by virtue of having the tag.
Please sign in to leave a comment.
0 Comments