Started by
InRaiYTS
on
Topic category: Help with Minecraft modding (Java Edition)
I'm trying to set up so that when a player has 4 different items in his inventory, he is given an achievement. However, it is not given. How to configure?
Use the 'custom trigger' function where it asks for your achievement's trigger.
Then, create a separate procedure with the 'on player update tick' global trigger. Use an 'if' bracket with 'and' functions to check that each of your four items is in the player's inventory. If all four of these conditions are true, use the 'give achievement' function to give the player your achievement.
It seems to have done, but when receiving items, the game crashes and does not allow to enter the world in subsequent attempts
It should look something like this. You do need to be careful running things on player update tick, as it's very easy to crash the game if you misplace something.
If you're worried about this, you could also just change the global trigger to 'when entity picks up item.' It wouldn't give the advancement if the items were transferred into the inventory via. a menu, but would still probably work in most cases.
Even receiving an item, the game crashes, I think it will be easier to remove this achievement
If this is the case, it’s more likely that there’s something the item is doing that crashes the game, not the achievement. Nothing in the above procedure, or the ‘picks up item’ variant should really be able to do that.
What specific error is this giving? And is the actual achievement procedure listed in the crash log as one of the issue sources?
There is nothing in the objects themselves. I wanted to send crash-reports, but I don't understand how to get the file URL
If you look at the crash log, the actual 'error' should be in light red, and it should be followed by a list of procedures that aren't working. (This is just in the 'console' tab of your workspace, and appears every time the client is run.) If it just says 'memory overload,' for example, then something's looping endlessly without a stop condition. More likely, there's a missing dependency somewhere- something might be using 'nearest entity of type,' but not finding an entity, and then trying to run a procedure on nothing. Just a general idea of what the problem is would be helpful!
if I understood correctly where to look, it says "BUILD FAILED"
@InRayYTS
Can you screenshot your console about the error message you get?
I don't really understand how I can send a screenshot here
You need to upload the file somewhere else, (mediafire, imigur, wix, etc;), and then copy the image URL and link it here. MCreator doesn't store the files itself.
https://www.mediafire.com/view/bcfgv1vh3pfm778/Screenshot_%2528153%2529.png/file
...Haven't really seen something like this before. It looks like something about the 'Heavenly Lord' procedure is causing problems? Could you maybe upload a screenshot of the procedure itself? If you click any of the links there, it will take you to the specific lines in the code that are causing issues, though it looks like it is specifically the advancement that's the source. (Sorry, this probably isn't very helpful.)
https://www.mediafire.com/view/ylrmzqy5qvg4791/Screenshot_%2528154%2529.png/file