#How do I put fortune in the ore with loot table?
16 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
How do I put fortune in the ore with loot table?
this might help #archived-example-scripts message
[Quote ➤](#archived-example-scripts message) Script to make a block respect fortune.
onEvent('block.loot_tables', event => {
event.addBlock('emendatusenigmatica:iron_ore', table => {
table.addPool(pool => {
pool.addItem('emendatusenigmatica:iron_chunk');
pool.addFunction({
"function": "minecraft:apply_bonus",
"enchantment": "minecraft:fortune",
"formula": "minecraft:ore_drops"
});
pool.addFunction({
"function": "minecraft:explosion_decay"
});
});
});
});
Edit: added the onEvent
theres examples for all of that in the example channels
and how to add silk touch to drop the block
[Quote ➤](#archived-example-scripts message) This is a script that reduces the influence of fortune on ores for 1.18.
Pseudocode of the loot table:
if (silk touch) then drop fullOre
if (not (silk touch) or is explosion) then drop $rawOre, $rolls times
if (fortune >= 1 and 25% chance) then drop $rawOre, $rolls times
if (fortune >= 2 and 25% chance) then drop $rawOre, $rolls times
if (fortune >= 3 and 25% chance) then drop $rawOre, $rolls times
more searching :P
Ticket closed!
when a break the block with silk the block is drop and the custom drop too
what does your code look like? i cant guess it
You can write your code in a codeblock by typing it between the codeblock delimiters:
```js :arrow_left:
onEvent('recipes', e => {
e.smelting('minecraft:glass', '#forge:sand').xp(.1)
})
``` :arrow_left:
As an example, :arrow_up: will look like this:
onEvent('recipes', e => {
e.smelting('minecraft:glass', '#forge:sand').xp(.1)
})
is here
Paste version of loottables.js from @ripe sleet