The script that I have works for Integers but the one I'm trying to get to is wrapped in a component (specifically auto-serial: {recipeProgress})
How do I modify the script so that it works with components? Thanks in advance!
startup:
let $BlockEntity = Java.loadClass('net.minecraft.world.level.block.entity.BlockEntity')
JadeEvents.onCommonRegistration((event) => {
const manaNbtKeys = ["recipeProgress"];
event.blockDataProvider("kubejs:recipe_progress", $BlockEntity).setCallback((tag, accessor) => {
const { blockEntity } = accessor;
manaNbtKeys.forEach((key) => {
if (blockEntity[key] != null) {
tag.putInt(key, blockEntity[key]);
}
});
});
});```
client:
```js
let $Block = Java.loadClass('net.minecraft.world.level.block.Block')
JadeEvents.onClientRegistration((event) => {
event.block('kubejs:recipe_progress', $Block).tooltip((tooltip, accessor) => {
const { serverData } = accessor
if (!serverData) return
let recipeProgress = serverData.get('recipeProgress')
if (recipeProgress) {
tooltip.add(`§bRecipe Progress: ${recipeProgress}`)
}
})
})```