KubeJS

KubeJS

61M Downloads

Please,Can you give some example templates?

blood789 opened this issue · 4 comments

commented

I want to modify the hardness of the original game block, the mining level, the durability of the tool, the mining level, etc., but the website gives too few examples.

commented

tier = tierOptions => {
int uses
float speed
float attackDamageBonus
int level
int enchantmentValue
Ingredient repairIngredient
}
foodProperties = food => { // note: uses functions instead of a = b
hunger(int)
saturation(float)
meat(boolean)
alwaysEdible(boolean)
fastToEat(boolean)
effect(String effectId, int duration, int amplifier, float probability)
removeEffect(String effectId)
}

For example, I don’t know how to use these 2 types

commented

onEvent('item.modification', event => {
event.modify('minecraft:stone_pickaxe', item => {
item.level = 5
item.enchantmentValue = 20
})
})

I wrote it like this, but it didn't work

commented

Alright… I’m on my phone right now, so this might sound weird:

  1. The things you are asking are structured in thedocs like they are, because they are done in the event like this:
onEvent('item.modification', event => {
  event.modify('minecraft:ender_pearl', item => {
    item.maxStackSize = 64
    item.fireResistant = true
    tier = tierOptions => {
    // now the level & stuff
    }
  })
})
  1. Docs are mentioned under issue #114
commented

Questions like this are most easily rectified by asking in the Discord: https://discord.gg/bPFfH6P. Also closing due to lack of response.