I've ported a map from MC Java for use in one of my PE servers, and as part of my usual fly-around to make sure everything was correct - I noticed the server kept crashing when a certain few chunks were loaded. As per the console output - InvalidArgumentException: "Unable to resolve "minecraft:milk_bucket" to a valid item" there are a/a few milk buckets somewhere that cannot be resolved to an item ID. I understand why this is happening, as MC Java and MCPE item ID's get quite different. Just not sure what I can do to fix it at this point. Does anyone have any ideas on how I can remove the item/s from the map? I have already used MCEdit to clear all entities and mess around with a few other things... so at this point I'm assuming the milk is in a chest. Maybe. A second question I had- How come PocketMine can handle mostly everything else when using a ported PC world... but milk crashes it? lol. Edit- Figured above question out. Thanks @corytortoise I know this topic may not have all too much to do with PocketMine itself.... so feel free to yell at me for that. As per the usual, thank you all in advance.
Maybe this code from ItemFactory could be useful? Perhaps you could register the Milk item so it doesn't throw that error. You'd probably want to figure out the ID and/or name difference between BE and JE though. Edit: Apparently PMMP handles milk buckets as a normal bucket with meta values representing different types, i.e. milk, water, lava. That's part of why the name milk_bucket causes issues, I think.
Hrmm. I'll take a look at that code. The ID and name difference - Java ID- 335 Name- minecraft:milk_bucket PE ID- 325:1 Name- bucket
Maybe you could create a plugin that searches all inventories in the world, looks for ID 335, and changes it to the BE equivalent?
Yea. From looking at the item factory code the name would cause an issue b/c PE uses meta values on buckets where Java just has different ID and names.... so I agree with your Edit you made. This would also break for all the other types of buckets. I know how to read this stuff... not how to create it. I'll give a shot at coding something... but I don't know what I'm doing. Edit- I thought I had generated my world without structures. So much for that working as intended. Would have made my life easier. Rip
Ok. So. Since I don't know PHP and cant code plugins for the life of me- I've just edited ItemFactory directly- and added this under line 352. if(strpos($str, 'minecraft:milk_bucket') !== false) { $b = explode(":", str_replace([" ", "minecraft:milk_"], ["_", ""], trim($str))); } I've tested and it makes buckets appear where milk buckets were before. However- No one use this. It does work, but it's a terrible idea. Edit - I'm using this just to remove milk. Then switching the world back to the pre-production server.
Aye. It will happen on any bucket. Feel free to use the code in my previous post (at your own risk.) and replace "minecraft:milk_" with "minecraft:water_"