#how to make a custom improvement in kubajs for thermal_expansion?

1 messages · Page 1 of 1 (latest)

arctic star
#

I just want to make custom improvements.
to generate an item with an NBT improvement tag

vocal whaleBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

visual wyvern
#

make your custom item, then in its recipe use this as the output:
Item.of('kubejs:my_custom_item', '{AugmentData: {RFMax: 2, Radius: 3}}')
The list of augment things can be found linked in the thermalpedia (install patchouli)

arctic star
visual wyvern
#

yeah

#

you could make it work without nbt, but that requires registering the item as an item based off a java class, which i have no experience doing in 1.18 (in 1.19+ its a lot easier)

arctic star
#

oh shit

visual wyvern
#

wdym?

arctic star
visual wyvern
#

what do you mean by "throw off the code"?

arctic star
#

send me the code

visual wyvern
white gladeBOT
#

[Quote ➤](#1097900921813487626 message) The code so far:

let BONE_TIER;

onEvent('item.registry.tool_tiers', event => {
  BONE_TIER = event.add('bone', tier => {
    tier.uses = 96
    tier.speed = 1.0
    tier.attackDamageBonus = 2.0
    tier.level = 2
    tier.enchantmentValue = 8
    tier.repairIngredient = 'minecraft:bone'
  })
})```
*--- other, normal startup scripts---*
```js
const $DeferredRegister = java('dev.architectury.registry.registries.DeferredRegister')
const $Tiers = java('net.minecraft.world.item.Tiers')
const $Item = java('net.minecraft.world.item.Item')
const $CreativeModeTab = java('net.minecraft.world.item.CreativeModeTab')
const $Registry = java('net.minecraft.core.Registry')
const $KnifeItem = java('com.nhoryzon.mc.farmersdelight.item.KnifeItem')

let ITEMS = $DeferredRegister.create('kubejs', $Registry.ITEM_REGISTRY)
ITEMS['register(net.minecraft.class_2960,java.util.function.Supplier)']('kubejs:bone_knife', () => {
  return new $KnifeItem(BONE_TIER)
})
ITEMS.register()
arctic star
#

thanks

visual wyvern
#

note its not specific to augments, its for a knife.
you would need to change the class for the augment class, and the paramaters you pass to its constructor.
It also looks to use fabric names for the register method, you would need to swap those for forge names

arctic star
#

so how do I figure out where to replace it?

visual wyvern
#

look at thermals code for the augment item class, and see what parameters it takes.
also copy the class name to replace the knife one (const $KnifeItem = java('com.nhoryzon.mc.farmersdelight.item.KnifeItem'))

visual wyvern
#

on cofhs github somewhere

arctic star
#

Did I do the right thing?

visual wyvern
#

no that is completely wrong

#

the first example is irrelevant, its the second example that you want

#

the first example is just for a custom bone tool tier

arctic star
#

I don't understand a damn thing I'm sorry

visual wyvern
#

then you should just use the otehr method,, where it wont be pickable in creative

#

or wait and see if someone else who has more experience with 1.18 custom registry objects comes along

arctic star
#

oh shit