Hammer Mining level incorrect on LAN.
SprinkCal opened this issue ยท 5 comments
Both of us are updated to newest version 1.7, host can hammer items as intended but joined player breaks blocks slowly as if they're using the correct tool(Jade shows a green tick for the mineability on host side but on other users its a red X)
I found a similar, but different issue with hammers not correctly mining blocks. When adding additional hammer recipes via KubeJS, the recipes do not work correctly when the world is first loaded (Jade showing a red X even with a diamond hammer), but after using the /reload command, the added KubeJS recipes work correctly. (Jade shows a green checkmark on any hammer of the same or better pickaxe tier)
I've had no issues with the included hammer recipes in a local single-player world.
Can you please send your KubeJS scripts? I don't know how the mod works and it would be nice to have something to test with.
I did some further testing and my issue may actually be completely separate. But just in case, here is a script with both working and non-working examples. This script was tested with a fresh instance containing only Forge 47.2.0, JEI 15.2.0.27, KubeJS 2001.6.3-build.83, and Ex Deorum 1.7 (and the necessary support libraries). Place the script into [MCinstance]\kubejs\server_scripts[name].js (The name of the file is unimportant as KubeJS will enumerate all *.js files in the directory):
ServerEvents.recipes(event => {
let hammering_tag = (input, output, amount) => {
event.custom({
"type": "exdeorum:hammer",
"ingredient": [
{
"tag": input
}
],
"result": output,
"result_amount": amount
})
};
let hammering_item = (input, output, amount) => {
event.custom({
"type": "exdeorum:hammer",
"ingredient": [
{
"item": input
}
],
"result": output,
"result_amount": amount
})
};
// These recipes do not work on first load, but do work after using the /reload command
// hammering_tag('forge:ores/iron', 'minecraft:raw_iron', 2.0);
// hammering_tag('forge:ores/gold', 'minecraft:raw_gold', 2.0);
// hammering_tag('forge:ores/copper', 'minecraft:raw_copper', 4.0);
// These recipes work correctly
hammering_item('minecraft:iron_ore', 'minecraft:raw_iron', 2.0);
hammering_item('minecraft:gold_ore', 'minecraft:raw_gold', 2.0);
hammering_item('minecraft:copper_ore', 'minecraft:raw_copper', 4.0);
// Use only one of the above blocks of function calls at a time
/* This is the equivalent code without the helper function, it essentially just inserts a json recipe file just as any other datapack
event.custom({
"type": "exdeorum:hammer",
"ingredient": [
{
"item": "minecraft:iron_ore"
}
],
"result": "minecraft:raw_iron",
"result_amount": 2.0
})
*/
});
It seems that my issue was caused by trying to use a forge tag list which is not yet populated when the hammer recipes are first processed. The recipe shows up in JEI when attempting to use the tag versions, but shows an [empty tag list] -> [output item] entry, which explains why it does not work correctly on the ores. Using the single item version does work correctly without any single-player issues.
@SprinkCal Fixed in Ex Deorum 1.9 (might take a bit till it's on CurseForge, but it's available right now on Modrinth)
@JondorTheBrinkinator If you haven't found a solution to the issue yet, please open a separate issue on GitHub