focamacho / RingsOfAscension

Rings of Ascension is a mod that uses the Curios API/Trinkets API to add 20+ news rings to your minecraft.
https://www.curseforge.com/minecraft/mc-mods/rings-of-ascension
MIT License
11 stars 10 forks source link

how can i edit drop chance and loot table? #96

Closed Sandman-Sleep closed 2 months ago

Sandman-Sleep commented 2 months ago

i'm not native english user, so excuse me please. thank you. i'm first at mods and datapacks too...

minecraft version : 1.20.4 platform : NeoForge mod used : RingsOfAscension-1.20.4-2.0.2.jar

first, i tried edit numbers in 2.0.2.jar file. open it with some zip program, enter data/ringsofascention/loot_modifiers/common and change experience.json

{ "type": "ringsofascension:rings_modifier", "conditions": [ { "condition": "random_chance", "chance": 1 # changed this number to 1, so i can get exp ring everytime i open spawn bonus chest } ], "loot_tables": [ "minecraft:chests/spawn_bonus_chest", "minecraft:chests/simple_dungeon", "minecraft:chests/buried_treasure", "minecraft:chests/ruined_portal" ], "ring": "ringsofascension:ring_experience" }

but this did not work. bonus chest did not contain exp ring. i tried type /loot insert(box's coordinate) loot minecraft:chests/spawn_bonus_chest several times, but still got no ring.

than, i saw your comment in curseforge website :

In reply to MokahTGS:

For 1.19.2 or lower, you can remove the loot tables from config file.

For 1.19.4+ you will need a Data Pack to replace the default loot modifier files, just use the same path and replace the "loot_tables" value with an empty array ( "loot_tables":[] ). You can see them here: https://github.com/focamacho/RingsOfAscension/tree/1.20.x/src/main/resources/data/ringsofascension/loot_modifiers

So, I search google and someone says datapack have to contain [pack.mcmeta] file and data folder. And I Found src/main/resources folder contain both [pack.mcmeta] and data folder So I download this [resources] folder, Rename it to [Rings of Ascension], open [pack.mcmeta] Change pack_format to 26. google says for 1.20.4, number 26 is correct. And go to data/ringsofascention/loot_modifiers/common and change experience.json to same as above("chance": 1) Last, I Create New World > More > Data Packs > Open Pack Folder > Copy Paste [Rings of Ascension] folder and minecraft UI shows selected packs are Ring of Ascension + Default + Mod Data. Bonus Chest : ON. and i still get no ring in Bonus chest. I feel this is not the right way. but i have to try. can you teach me the right way? please? oh, and can i use this datapack for multiplayer too? like, put it in the NeoForge Server/world/datapacks?

focamacho commented 2 months ago

Hello! The easiest solution for your problem is probably to replace the minecraft's own Spawn Bonus Chest loot table to include the ring. Take a look at this datapack for an example: ringbonuschest.zip

Sandman-Sleep commented 2 months ago

thanks. now i can edit vanilla chest/archaeology to create data pack. for me, global_loot_modifier thing is not working but this datapack work really well!

{
  "bonus_rolls": 0.0,
  "entries": [
    {
      "type": "minecraft:item",
      "name": "ringsofascension:ring_experience"
    },
    {
      "type": "minecraft:item",
      "name": "ringsofascension:ring_jump_boost"
    },
    {
      "type": "minecraft:item",
      "name": "ringsofascension:ring_night_vision"
    },
    {
      "type": "minecraft:item",
      "name": "ringsofascension:ring_slow_resistance"
    },
    {
      "type": "minecraft:item",
      "name": "ringsofascension:ring_steadfast_steps"
    },
    {
      "type": "minecraft:item",
      "name": "ringsofascension:ring_water_walking"
    }
  ],
  "rolls": 1.0
 },

this make chest will spawn random common ring! maybe later i will add weight to set the chance of each ring, but now i'm happy to see rings are finally spawn.

use same way to fix tarot cards not spawning too. thank you again. and thanks for the ring mod.