#Gametest guide
1 messages · Page 1 of 1 (latest)
Gametest framework?
Gotcha, the wiki seems pretty clear. I'm not sure what exactly you need help with
If there's a data pack feature you want to test, set up a test instance that tests that. Though I can't think of a lot of features that would benefit from that deliberate of a test
I come from a software development background so testing is pretty important to me :3
The wiki is definitely far from clear for a bunch of random things. Especially when you compare it to Microsoft's documentation on the equivalent framework for bedrock edition. The wiki is not documentation and it shows. If there was documentation, I'd expect something like a quick start guide and detailed documentation of every bit of the framework so I can learn how to actually use the framework to its fullest. But right now I'm stuck with referencing the wiki which has so far given me not enough information and out of date information.
So i'm just wondering if I'm looking in the wrong place
Is this is one of those things where there's no official documentation and I just need to figure everything out by trial and error?
it might just be easier for me to test my datapack like its a minecraft mod if i cant figure out how to test with datapacks
What exactly are you trying to test? That might help us help you better
I don't think it's an issue of poor documentation and rather a limited test system. It's not really meant to do a lot
there's not a whole lot of available usecase for datapack purposes. its mostly meant for the devs and modders. the block based tests described on the wiki are the only thing you can design for yourself without mods
Yeah the friction here I think is that data packs are definitely not software development. Some principles of traditional programming carry over, and more of the game has been opened up to us with JSON files, but functions and commands are way closer to pseudo code, and have extremely limited need, frankly, to be tested so deliberately, because they're not actual code/coding. It's just a series of fancy cheat codes
Well to give a specific problem i have, i can't figure out how to register a test function. The wiki says there's a test_function registry that's used for function based tests, is it possible to create a function in that registry with datapacks?
As it is a registry, it's presumably a folder at data/<namespace>/test_function that you put .mcfunction files in
yep, I have had no success with putting functions there, tests cant find functions. i'm looking through the decompiled source and it is indeed a registry but i havent figured out yet if you can register functions there with datapacks. still looking around the codebase
Ah you may not be able to with data packs, that's a good point. It does say that it's intended for devs and modders
it would be a little silly if you can't register test functions with datapacks given that you defne test instances, test environments, and functions with datapacks, hopefully that isn't the case 🙃
you cannot register test functions with datapacks. they are as mentioned a built-in registry
block-based tests are the only type you can make for yourself without mods
If you want to test functions, your best bet is to make a makeshift system yourself. You can store the success of running a function with execute store success, return error values halfway if necessary with return, etc.
ah it's not referring to mcfunctions, it's referring to java functions :P
yeah i imagine that a temporary solution would be using command blocks in a block based test if i really want to use mojang's gametest framework
i might try writing a tiny mod that lets you write tests with mcfunctions
And then you could use this for logging
#bs.log:help Log messages in the chat with varying levels of severity. 🔧 Functions: You can find below all functions available in this module. Log Messages: Error Example: Log an error message that...
Here's the solution: https://github.com/misode/packtest