KubeJS

KubeJS

69M Downloads

Problem with the number provider class?

TheButterbrotMan opened this issue ยท 4 comments

commented

Minecraft Version

1.18.2

KubeJS Version

kubejs-fabric-1802.5.4-build.502

Rhino Version

rhino-fabric-1802.1.14-build.188

Architectury Version

architectury-4.5.75-fabric

Forge/Fabric Version

Fabric: 0.14.8

Describe your issue

I created a new loottable for minecraft:polar_bear, the loottable works but not the ratios. For example i barely get bear_skin_black, and sometimes 0-4 furs.

onEvent('entity.loot_tables', event => {
 
  event.addEntity('minecraft:polar_bear', table => {
    table.addPool(pool => pool.addItem('betteranimalsplus:bear_skin_black', 4))
    table.addPool(pool => pool.addItem('#minecraft:fishes', 1, [0,4]))
    table.addPool(pool => pool.addItem('environmentz:polar_bear_fur', 1, [0,2]))
    table.addPool(pool => {
      pool.addItem('betteranimalsplus:blackbearhead_kermode').weight(1)
      pool.addEmpty(19)

    })

  })
  
})

Crash report/logs

No response

commented

Can you export the loot json for me somehow?

You should be able to call table.toJson() at the very end of the event to get a json object for me to check out

commented
commented

Here it is prettified:

{
  "type":"minecraft:entity",
  "pools":[
    {
      "rolls":1.0,
      "entries":[
        {
          "type":"minecraft:item",
          "name":"betteranimalsplus:bear_skin_black",
          "weight":4
        }
      ]
    },
    {
      "rolls":1.0,
      "entries":[
        {
          "type":"minecraft:item",
          "name":"minecraft:cod",
          "weight":1
        }
      ]
    },
    {
      "rolls":1.0,
      "entries":[
        {
          "type":"minecraft:item",
          "name":"environmentz:polar_bear_fur",
          "weight":1
        }
      ]
    },
    {
      "rolls":1.0,
      "entries":[
        {
          "type":"minecraft:item",
          "name":"betteranimalsplus:blackbearhead_kermode",
          "weight":1
        },
        {
          "type":"minecraft:empty",
          "weight":19
        }
      ]
    }
  ]
}
commented

Ugh, well that seems confirmed then... I'll check it out when I have time