Whats new:
-An extra inventory tab for the items that the mods adds
-Registered the crafting recipe
-Feature of sapphire added
The creation of the new Tab was pretty easy. I only needed to register it with
“CreativeModeTab = Registry.register”
then just add every item in this format:
output.accept(ModItems.SAPPHIRE)
output.accept(ModItems.MOONSTONE)
…
The custom recipes were a bit more difficult.
I created SapphireUpgradeRecipe. It scans the crafting grid to check if the center slot has an item with durability, surrounded by Sapphires. Inside assemble(), it copies the item and calculates a +20% increase to its MAX_DAMAGE.
I first was confused because i thought damage would be the damage you are dealing with it (just like in the ItemEdit Plugin or Paper)
Though, the damage on the item is meant. So basically the durability.
val currentMax = result.maxDamage
val newMax = currentMax + ceil(currentMax * 0.20).toInt().coerceAtLeast(1)
result.set(DataComponents.MAX_DAMAGE, newMax)
In MoonstoneUpgradeRecipe, when you craft a item with 8 Moonstones around it, it attaches a custom NBT marker (crystalcave_moonstone_upgrade) to the item’s data components.
I will add a ServerTickEvents event loop in the future which then will target every monster in a 64 block radius or soemthing like that.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.