#Custom enchantments experience cost

1 messages · Page 1 of 1 (latest)

brave osprey
#

About the min_cost and max_cost parameters in custom enchantments, are they in experience points ? And if yes, do you know an experience level to points converter (and in the other way)?

verbal estuaryBOT
#

<@&1201956957406109788>

Someone will come and help soon!

💬 While you wait, take this time to provide more context and details.

🙇 After a while, hit the Summon Helpers button to ping the helper team. They'll be happy to help you

✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve

muted silo
#

They should be in levels

brave osprey
#

Are you sure? Because it seems very high for that

#

This is luck of the sea for exemple :

{
  "anvil_cost": 4,
  "description": {
    "translate": "enchantment.minecraft.luck_of_the_sea"
  },
  "effects": {
    "minecraft:fishing_luck_bonus": [
      {
        "effect": {
          "type": "minecraft:add",
          "value": {
            "type": "minecraft:linear",
            "base": 1.0,
            "per_level_above_first": 1.0
          }
        }
      }
    ]
  },
  "max_cost": {
    "base": 65,
    "per_level_above_first": 9
  },
  "max_level": 3,
  "min_cost": {
    "base": 15,
    "per_level_above_first": 9
  },
  "slots": [
    "mainhand"
  ],
  "supported_items": "#minecraft:enchantable/fishing",
  "weight": 2
}```
#

It isn't specified in the changelog if it is levels or points, or something new

muted silo
# brave osprey About the `min_cost` and `max_cost` parameters in custom enchantments, are they ...

Here you can find a table and graph showing how much points each level needs https://minecraft.wiki/w/Experience

Minecraft Wiki

Experience orbs (EXP or XP for short) can be obtained by gathering experience orbs from mining, defeating mobs, breeding, trading, fishing, completing advancements,‌ and using grindstones and furnaces. Experience orbs gained during a player's life affects the player's score on the death screen. While having no direct effect on the player charact...

#

It could also be points now that I look at the example

brave osprey
#

Hmm, it seems low for points too

muted silo
#

You have to try around and see how much the cost changes

#

level 1 is 7 points, level 2 is 16 points

brave osprey
#

Yep it is likely points

#

If you have a converter from points to level that is easy to use, could you put it in the /resources ? It could be useful, for custom enchantments and other things too

hushed surge
#

It’s just some basic math

brave osprey
#

Hey Playful

hushed surge
#

You could setup like a table if you need it lmao

brave osprey
#

Yes it is not hard to calculate, just that having a website anyone can acces in about 5/10 seconds (less if you keep it open because you know you have to work with xp) is easier

muted silo
brave osprey
#

The wiki is also limited to 40 levels (even though you rarely need more)

muted silo
#

64*

brave osprey
#

Yep right

#

40 is the graphic table

hushed surge
#

If you need to calculate beyond that I have to wonder what you are doing

brave osprey
#

I don't personally, but considering the number of people who make datapacks, I think some people do from time to time

#

It also work for example for people who use xp bottling systems which ask how much points you want to store and not levels

#

And who want to store like 100 levels

#

By the way, why do you have to specify two times the per_level_above_first?
Unless I missed something

#

Which does the game choses to use?

muted silo
#

you specif it once for the min and once for the max

brave osprey
#

yep

#

but why do you put it two times

#

Likely I don't understand something

muted silo
#

you could use different values (less for the min version for example) then the gap becomes bigger the higher the level

brave osprey
#

Well how is it used?

muted silo
#

This calculates the min value:

"min_cost": {
    "base": 15,
    "per_level_above_first": 9
  }

so the "per_level_above_first": 9 only counts for that value

#

same for the max value

brave osprey
#

So, it is randomly between 15 and 65 for the level one, and 15+9 and 65+9 for the level two for luck of the sea, is that right?

muted silo
#

yes

brave osprey
#

And for level three it is randomly from 15+(9*2) and 65+(9*2)

muted silo
#

yes

brave osprey
#

no mb

#

So

#

No ok I get it
Im an idiot

#

Just, is it two,three,four different rolls for level three, four, five?

muted silo
#

it is random every time

brave osprey
#

Hum

#

Like, if you roll a level five enchantment which have a random per_level_above_first of between 9 and 20, do you roll it once (for exemple you roll 11 and it is the rolled default cost + 4*11) or do you roll it five time (and it is for exemple the rolled default cost and 9+15+12+18)

#

It is just a random question though

muted silo
#

For level five, it goes like this:

  • calculate the min and max (min: 15 + 9 * 4 = 51, max: 65 + 9 *4 = 101)
  • final value = random(min:51, max:101)
  • final value: 76 for example
brave osprey
#

Oh ok that is the way it's done

#

It makes sense

#

Thanks for the help!