You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> datapack build Farting.mcf
Traceback (most recent call last):
File "/home/lomnom/.local/bin/datapack", line 8, in <module>
sys.exit(run())
File "/home/lomnom/.local/lib/python3.9/site-packages/datapack/cli.py", line 63, in run
_run_build(args)
File "/home/lomnom/.local/lib/python3.9/site-packages/datapack/cli.py", line 107, in _run_build
success = compile(outdir, args.files, args.verbose, args.nofiles, args.zip, args.hide)
File "/home/lomnom/.local/lib/python3.9/site-packages/datapack/compiler.py", line 29, in compile
namespace.compile(verbose, hide)
File "/home/lomnom/.local/lib/python3.9/site-packages/datapack/namespace.py", line 145, in compile
func.commands[i] = self.post_process_line(line, hide)
File "/home/lomnom/.local/lib/python3.9/site-packages/datapack/namespace.py", line 227, in post_process_line
callfuncname = self.instantiate_string_function(callfuncname, stringdata)
File "/home/lomnom/.local/lib/python3.9/site-packages/datapack/namespace.py", line 259, in instantiate_string_function
copy.compile()
File "/home/lomnom/.local/lib/python3.9/site-packages/datapack/function.py", line 265, in compile
self.process_line()
File "/home/lomnom/.local/lib/python3.9/site-packages/datapack/function.py", line 563, in process_line
add_param(paramlist[paramindex], expression, entitytags)
File "/home/lomnom/.local/lib/python3.9/site-packages/datapack/function.py", line 544, in add_param
augment_int(func.name + '.' + p, self.reference_path(givenparams[i]), '=', self.namespace))
NameError: free variable 'i' referenced before assignment in enclosing scope
Farting.mcf:
randA=#i
randB=#i
randC=#i
randD=#i
def getRandomNums:
sacrifice=summon marker 0 0 0
randA=data get entity sacrifice UUID[0] 1
randB=data get entity sacrifice UUID[1] 1
randC=data get entity sacrifice UUID[2] 1
randD=data get entity sacrifice UUID[3] 1
kill sacrifice
bounded=#i
def bound min#i max#i num#i:
max-=min
num%=max
bounded=min
bounded+=num
def giveaway player#p itemA#s maxA#i itemB#s maxB#i itemC#s maxC#i itemD#s maxD#i:
getRandomNums
bound 0 maxA randA
give player itemA bounded
bound 0 maxB randB
give player itemB bounded
bound 0 maxC randC
give player itemC bounded
bound 0 maxD randD
give player itemD bounded
def veganism player#p:
giveaway player carrot 16 bread 16 baked_potatoes 16 apples 8
Farting.mcf does not compile, and the compiler crashes abnormally.
Compiles if the function bound is removed.
The text was updated successfully, but these errors were encountered:
Farting.mcf:
Farting.mcf does not compile, and the compiler crashes abnormally.
Compiles if the function
bound
is removed.The text was updated successfully, but these errors were encountered: