znsuyt

make a datapack for 1.21.1 neoforge which works with re-avaritia mod where if we kill any mob they will drop random avaritia items from re-avaritia mod

Kodari AI
KodariOct 26 at 8:45 am 1
MobAvaritiaDrops
Creates a Minecraft 1.21.1 NeoForge datapack compatible with Re-Avaritia mod. When any mob is killed, the datapack triggers a loot system that randomly drops items from the Re-Avaritia mod's item pool. The system uses a custom loot table and entity death event detection to assign random Avaritia items as drops, ensuring compatibility with the mod's item registry and providing a balanced random drop rate for all mob types.

Download the ZIP with the export button and extract avaritia_mob_drops into your world’s datapacks/ folder. Run /reload, then /datapack list to verify it loaded. Killing a mob should grant one random listed item; test the loot function directly with /function avaritia_mob_drops:grant_drop.

znsuyt

any mob is not droping avartia items

Kodari AI
KodariOct 26 at 8:51 am 1

Fixed the invalid Re-Avaritia item ID: avaritia:neutronium_ingot is now avaritia:neutron_ingot. The invalid ID could prevent the random loot table from loading. The reward goes into the killer’s inventory.

Download the updated ZIP with the export button, replace the datapack folder in world/datapacks/, then run /reload. Check /datapack list, and test with /function avaritia_mob_drops:grant_drop.

znsuyt

make that mob will drop avaritia items instead of there items like meet beaf rotten flesh string and items will drop on ground not appear in our inventory

Kodari AI
KodariOct 26 at 8:53 am 1
  1. Make the random Avaritia reward spawn on the ground instead of entering the killer’s inventory.

  2. Disable vanilla mob loot so the usual drops are suppressed, and enable this when the pack loads.

  3. Note: this gamerule affects mob loot across the world, not just the player-killed mob.

Updated so the random Avaritia item spawns on the ground near the killer, and normal mob loot is suppressed.

Note: The pack sets doMobLoot to false for the whole world, affecting mob drops and XP—not just mobs killed by a player. If you remove the pack, restore them with /gamerule doMobLoot true.

Download the updated ZIP using the export button, extract avaritia_mob_drops into world/datapacks/, run /reload, and check /datapack list. Test with /function avaritia_mob_drops:grant_drop.

znsuyt

these items will drop randomly there only some ingots are droping again and again and the normal items that mobs drop on death that stops now droping where the animal is killed there these random items will drop not on our place

Kodari AI
KodariOct 26 at 9:03 am 1

The old advancement method spawned the reward at the killer. I’ve replaced it with vanilla mob loot-table overrides, so a random Avaritia item drops on the ground where the vanilla mob dies. The listed items now have equal chances, and the mob’s usual item drops are replaced; XP is enabled again.

Download the updated ZIP with the export button and install it in the server world’s datapacks/ folder. Run /reload, then check /datapack list. Custom mobs added by other mods need their own loot-table override, so they aren’t covered automatically.

znsuyt

some items are coming back to back i want random 3-4 times is fine but again and again is not

Kodari AI
KodariOct 26 at 9:09 am 1

The pack currently rolls a random item on every mob death, so the same item can appear in consecutive drops. Do you want to drop an item only every 3–4 mob kills, or keep dropping items but prevent the same item from repeating until 3–4 other drops have happened?

znsuyt

prevent from repeating until 3-4 other drops have happened

Kodari AI
KodariOct 26 at 9:14 am 1
  1. Mark drops from the shared loot table so only these items are processed.

  2. Track the last three drops and reroll any repeat before it can be picked up.

Repeated items are now rerolled if they match any of the previous three mob drops. The history is shared across the world and persists through reloads.

Download the ZIP using the export button, extract the datapack folder into world/datapacks/, then run /reload. Check it with /datapack list; you can also run /function avaritia_mob_drops:load to test the load function.

znsuyt

only these items are coming again and again i want every re-avaritia mod's item will come

Kodari AI
KodariOct 26 at 9:18 am 1

You’re right—the drop pool and reroll logic only include 10 hardcoded Avaritia item IDs, so no other items from the mod can drop. A datapack can’t use a wildcard to select every avaritia:* item; it needs the full item list or a mod-provided tag containing all of them.

Please send the item IDs (shown by enabling F3+H and hovering over each item), or the name of an all-items tag provided by your Re-Avaritia version. Then I can add the complete set to the drop pool and repeat-prevention logic.

znsuyt

search and add your own

Kodari AI
KodariOct 26 at 9:25 am 2
  • Expand the loot pool to all 45 Avaritia items and placeable blocks listed by the mod.

  • Update the item-to-index mapping so the three-drop repeat guard covers the expanded pool.

  • Keep the existing shared drop-history behavior.

Expanded the drop pool to 45 base AvaritiaNeo item IDs, including its placeable blocks, using the public 1.21.1 NeoForge item list. The three-drop repeat protection now covers the expanded pool too.

Download the ZIP with the export button, extract the datapack folder into world/datapacks/, then run /reload. Check it with /datapack list; test initialization with /function avaritia_mob_drops:load.

Kodari can make mistakes. Review important code before using.
Files
avaritia_mob_drops
Code
90 404
avaritia_mob_drops/data/avaritia_mob_drops/function/reroll.mcfunction
scoreboard players random #candidate avdrop 1 45
execute if score #candidate avdrop = #recent_1 avdrop run function avaritia_mob_drops:reroll
execute if score #candidate avdrop = #recent_2 avdrop run function avaritia_mob_drops:reroll
execute if score #candidate avdrop = #recent_3 avdrop run function avaritia_mob_drops:reroll
scoreboard players operation #item avdrop = #candidate avdrop
execute if score #item avdrop matches 1 run data modify entity @s Item.id set value "avaritia:crystal_matrix_block"
execute if score #item avdrop matches 2 run data modify entity @s Item.id set value "avaritia:neutronium_block"
execute if score #item avdrop matches 3 run data modify entity @s Item.id set value "avaritia:infinity_block"
execute if score #item avdrop matches 4 run data modify entity @s Item.id set value "avaritia:compressed_crafting_table"
execute if score #item avdrop matches 5 run data modify entity @s Item.id set value "avaritia:double_compressed_crafting_table"
execute if score #item avdrop matches 6 run data modify entity @s Item.id set value "avaritia:extreme_crafting_table"
execute if score #item avdrop matches 7 run data modify entity @s Item.id set value "avaritia:compressor"
execute if score #item avdrop matches 8 run data modify entity @s Item.id set value "avaritia:neutron_collector"
execute if score #item avdrop matches 9 run data modify entity @s Item.id set value "avaritia:infinity_chest"
execute if score #item avdrop matches 10 run data modify entity @s Item.id set value "avaritia:copper_singularity"
execute if score #item avdrop matches 11 run data modify entity @s Item.id set value "avaritia:iron_singularity"
execute if score #item avdrop matches 12 run data modify entity @s Item.id set value "avaritia:gold_singularity"
execute if score #item avdrop matches 13 run data modify entity @s Item.id set value "avaritia:lapis_singularity"
execute if score #item avdrop matches 14 run data modify entity @s Item.id set value "avaritia:redstone_singularity"
execute if score #item avdrop matches 15 run data modify entity @s Item.id set value "avaritia:quartz_singularity"
execute if score #item avdrop matches 16 run data modify entity @s Item.id set value "avaritia:diamond_singularity"
execute if score #item avdrop matches 17 run data modify entity @s Item.id set value "avaritia:emerald_singularity"
execute if score #item avdrop matches 18 run data modify entity @s Item.id set value "avaritia:amethyst_singularity"
execute if score #item avdrop matches 19 run data modify entity @s Item.id set value "avaritia:netherite_singularity"
execute if score #item avdrop matches 20 run data modify entity @s Item.id set value "avaritia:dark_matter_singularity"
execute if score #item avdrop matches 21 run data modify entity @s Item.id set value "avaritia:red_matter_singularity"
execute if score #item avdrop matches 22 run data modify entity @s Item.id set value "avaritia:infinity_singularity"
execute if score #item avdrop matches 23 run data modify entity @s Item.id set value "avaritia:cosmic_meatballs"
execute if score #item avdrop matches 24 run data modify entity @s Item.id set value "avaritia:ultimate_stew"
execute if score #item avdrop matches 25 run data modify entity @s Item.id set value "avaritia:record_fragment"
execute if score #item avdrop matches 26 run data modify entity @s Item.id set value "avaritia:diamond_lattice"
execute if score #item avdrop matches 27 run data modify entity @s Item.id set value "avaritia:crystal_matrix_ingot"
execute if score #item avdrop matches 28 run data modify entity @s Item.id set value "avaritia:neutron_pile"
execute if score #item avdrop matches 29 run data modify entity @s Item.id set value "avaritia:neutron_nugget"
execute if score #item avdrop matches 30 run data modify entity @s Item.id set value "avaritia:neutronium_ingot"
execute if score #item avdrop matches 31 run data modify entity @s Item.id set value "avaritia:infinity_catalyst"
execute if score #item avdrop matches 32 run data modify entity @s Item.id set value "avaritia:infinity_ingot"
execute if score #item avdrop matches 33 run data modify entity @s Item.id set value "avaritia:endest_pearl"
execute if score #item avdrop matches 34 run data modify entity @s Item.id set value "avaritia:matter_cluster"
execute if score #item avdrop matches 35 run data modify entity @s Item.id set value "avaritia:infinity_sword"
execute if score #item avdrop matches 36 run data modify entity @s Item.id set value "avaritia:skullfire_sword"
execute if score #item avdrop matches 37 run data modify entity @s Item.id set value "avaritia:infinity_bow"
execute if score #item avdrop matches 38 run data modify entity @s Item.id set value "avaritia:infinity_axe"
execute if score #item avdrop matches 39 run data modify entity @s Item.id set value "avaritia:infinity_pickaxe"
execute if score #item avdrop matches 40 run data modify entity @s Item.id set value "avaritia:infinity_shovel"
execute if score #item avdrop matches 41 run data modify entity @s Item.id set value "avaritia:infinity_hoe"
execute if score #item avdrop matches 42 run data modify entity @s Item.id set value "avaritia:infinity_helmet"
execute if score #item avdrop matches 43 run data modify entity @s Item.id set value "avaritia:infinity_chestplate"
execute if score #item avdrop matches 44 run data modify entity @s Item.id set value "avaritia:infinity_leggings"
execute if score #item avdrop matches 45 run data modify entity @s Item.id set value "avaritia:infinity_boots"