-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Command output type for rituals #22
Comments
That's already possible by using the KubeJS completion event for the ritual: However, making this a possible output type would have the benefit of it showing up in the JEI/REI integration if properly implemented. Not sure what that would look like. Maybe a command block with a custom tooltip that you can define per command output. But I don't really see the need for that since it's already possible with the event. And the symbol for a command output within JEI/REI will be possible when I find the time to implement dummy outputs. Dummy outputs are outputs you can define in your recipe that will not actually be handled by the altar and they are just there for display purposes. You can use them if you do some custom behavior with the aforementioned event. The only difference would be the data pack support but I recommend using KubeJS anyways so that's likely a "no" from me.
|
No worries, I'm more familiar with datapacks so that's what I've been using for making rituals, didn't know commands could already be done with KubeJS. |
I'll keep that open for now for consideration when I have more time to think about it. Thanks for the idea tho! |
Making some progress using KubeJS for this. In the Complete Event I need a way to identify which ritual was completed to trigger the accompanying command, however the ID that's returned is a long string of random letters/numbers:
Results in: I was planning to have an if statement checking the ID for each ritual I've made, but after seeing that output I figured there must be a better way.
|
KubeJS assigns a dynamic ID if you don't specify one explicitly resulting in the mess you see there. event.recipes.summoningrituals.altar("diamond").id("kubejs:summoning/diamond") This example would use KubeJS as the namespace. It doesn't matter what the recipe ID will be as long as it's unique or it will override other recipes with the same ID. The namespace (the string before the colon) will define which mod this recipe belongs to. Modpack developers usually choose KubeJS or a custom namespace matching their pack name to make it clear that the recipe was custom-made. |
Awesome explanation, thank you! One last thing, do recipe inputs support NBT? I can assign NBT to the output item, but doing the same to the input has no effect and the ritual accepts any version of that item (eg. enchanted book with Sharpness I is considered the same as Sharpness V). I've tried these both: .input(Item.of("enchanted_book", 1, {StoredEnchantments:[{id:"minecraft:sharpness",lvl:5}]})) .input(Item.withNBT("enchanted_book", {StoredEnchantments:[{id:"minecraft:sharpness",lvl:5}]})) I have the NBT Crafting mod installed. |
These are all basic KubeJS questions you should ask on the KubeJS Discord. 😀 Items ignore NBT by default. You have to explicitly tell it to check NBT. There might also be a problem with the number in the object you pass to the item as well. In JavaScript, all numbers are floating point and when converting it to Java, this mostly results in a double which will not be accepted by Minecraft because it's not valid for enchantments. This can be avoided by passing the whole NBT object as a string. Two solutions: Item.of("enchanted_book", 1, `{StoredEnchantments:[{id:"minecraft:sharpness",lvl:5}]}`).strongNBT() Item.of("enchanted_book").enchant('minecraft:sharpness', 5) |
Ah alright, thanks again! Sorry for the irrelevant questions, still new to this so not sure where the line between your mod and KubeJS was. I've joined the discord and any further questions will be asked there :) |
Is there any examples of using the summon command in kubejs in a instance like this i cant really find one and im new to it and the mob output function in summoning a mob is removing all the bosses weapons and armor so he cant do his moveset |
Describe the feature/addition!
An additional output type that executes commands upon ritual completion.
Example (in datapack format):
This ritual's output would create a diamond, summon a cat, then kill all creepers within a 100 block radius.
Why would like to see this feature/addition?
Commands would add unlimited flexibility to ritual outputs - teleporting, weather-changing, potion effects, /fill, etc.
It may also help compatibility with other mods, eg. in the case of #17, a /summon command could be used to properly apply modded NBT to the mob that's summoned:
Personally I want this feature so I can have Eldritch Mobs as the result of rituals, using the /summon_eldritch command provided by that mod.
The text was updated successfully, but these errors were encountered: