#Any way to make fortune work on a custom ore?
110 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
just copy the ore loot table json from other mods, adjust the name of item drop, and place it into the right path
and this will make fortune work on that ore?
i'm a literal noob cause i've never done this before
Normally other modded ores use the same or similar logic with enchantments and you can easily find one in open sourced mods to learn the pattern. Here's an example of zinc from create
https://github.com/Creators-of-Create/Create/blob/mc1.20.1/dev/src/generated/resources/data/create/loot_tables/blocks/zinc_ore.json
Okay, i found the json
i will try to make it work, but i need to edit the json inside the mod or create a new js file?
||sorry if i'm annoying lol||
This is what i did so far (i have no clue what most of the code does so forgive me if i did something really stupid)
say, if you have a custom ore called kubejs:some_ore, you should create the file at this path
(YOUR MODPACK)/kubejs/data/kubejs/loot_tables/blocks/some_ore.json
what it needs to be?
It should be the name of your ore block
oh wait, you create the block in a different namespace?
ummm, i'm not sure what this means
(YOUR MODPACK)/kubejs/data/majruszsdifficulty/loot_tables/blocks/some_ore.json
no, that folder for the mod does not exist
should i create it and move the file to that folder?
yes
okay
okay, i did it
i check if it works
the modpack loaded up without any error, but somehow it doesn't work
Does the block drop itself when mined with silk touch?
Have you registered the shard item?
likeee how?
like how you did with the block
i don't think so
this is an existing mod in the pack, i just wanted fortune to work on this ore bc it does not works on it by basic
then it shouldn't be called custom ore
my bad for that
english is not my first language
sooo is it still possible somehow or should i just stop trying?
Have you reload or reboot the game?
and you tested it in your single player world, right?
yes
post the path where the json now locates
and the name
Please send your Minecraft log. It can be found at ./logs/latest.log.
Note! Minecraft and KubeJS logs differ. Please send the latest.log, not a KubeJS log.
Please send the file directly, without links or snippets.
Paste version of latest.log from @polar sand
weirdly I see nothing wrong
The block still only drops one shard?
yes
i tried with: luck V tinkers pick (acts as fortune 5), netherite pick with fortune 3 / silk touch
well then, I have a small cursed trick for this
let's see
||cursed movements needed? Like in hotel transylvania when the mummy tried to summon a sandstorm? xD||
oh, but before that, change the item name in the loot table json into something else, like minecraft:emerald and check if the block starts to drop emerald.
yeah
i reboot the pack
Paste version of enderium_shard_ore.json from @polar sand
ok, seems right
nice
btw you don't have to reboot
you can use /reload command
and the loot will be updated
can i ask what this line does? Or it's just needed bc of minecraft things?
it just sits under the code line which should activate fortune (but it doesn't lol)
just weird for me to see "explosion decay" in a code like this
It's to determine how the loot will be affected by explosion
And some gamerule stuff
tried with all 3 picks again
Thanks!
I can only guess the mod does something to prevent the loot from being overwritten
So one way is to listen to block broken event and add the bonus loot in the event
i think i just give up on this...
BlockEvents.broken("majruszsdifficulty:enderium_shard_ore", event => {
const placeHolder = "minecraft:emerald"
const desiredMaterial = "majruszsdifficulty:enderium_shard"
const {level, player, player:{mainHandItem}, block} = event
const $Block = Java.loadClass("net.minecraft.world.level.block.Block")
const emeraldOre = Blocks.EMERALD_ORE
const pseudoDrops = $Block.getDrops(emeraldOre.defaultBlockState(), level, block.pos, null, player, mainHandItem)
pseudoDrops.forEach(drop => {
if(drop.id != "minecraft:emerald") return;
block.popItem(Item.of(desiredMaterial).withCount(drop.count))
})
})
Put this in server script

