Occultism KubeJS

Occultism KubeJS

3M Downloads

Example crushing Code does not work, even changing tags.

Closed this issue · 9 comments

commented

Maybe I am a very new KubeJS user, but your server example code clearly shows the following, and it simply does not work.

event.recipes.occultism.crushing(
		'2x #forge:ores/iron',
		'#forge:tools/swords'
	)

I even tried changing, for neoforge, to'#c:ores/iron', '#minecraft:swords'. I also tried 'minecraft:iron_ore', '#minecraft:swords', 'minecraft:iron_ore', 'minecraft:iron_sword', but, no amount of changing ingredients and tags let me add any crushing recipe at all to the game.

I believe this is a bug, mainly because even your example code does not work. Perhaps it is registering ingredients or tags differently in neoforge? Spirit fire works just fine, but crushing does not. event.recipes.occultism.crushing('6x minecraft:emerald_ore', 'minecraft:iron_sword' does absolutely nothing but error: unable to cast 'result:occultism:recipe_result' value '6x minecraft:emerald_ore' to 'occultism:recipe_result'!. Again, regardless of what set of tags or ingredients I put in, nothing works.

OKjs Version: is 1.21.1-neoforge-1.2.1.
Occultism Version: 1.21.1-neoforge-1.154.0
Neoforge Version: .34

commented

@desagas thanks for reporting, where is that example from?

It's 1.20.1 code instead of 1.21.1 so I probably missed updating documentation somewhere.

The actual code running if you check out this repo is this: https://github.com/klikli-dev/occultism-kubejs/blob/version/1.21.1/runs/client/kubejs/server_scripts/example.js

commented
commented

I suspect you somehow got the link to an old version, because the code you posted was correct in older minecraft and kubejs versions!

No worries, I will close this issue, if any problems pop up you can open a new one :)

commented

Sorry to continue this, but, I am having a lot of trouble putting in Entities for sacrifice in rituals. I have tried the way Occultism does, in their recipe builder, but that does not work. I have tried just putting in "cows" or "cow" or "#minecraft:cow" or "minecraft:cow" or "Entity.Cow," but after trying for a couple of hours, I can not find a single example of a custom ritual using an sacrifice.

My current code is described below, but I can not get the entity to properly work for this, KubeJs keeps telling me "can not convert to string or tag," when referring to the entityToSacrifice

    event.recipes.occultism.ritual(
        'minecraft:iron_ore',
        [
            "#c:raw_materials/iron",
            "#c:raw_materials/iron"
        ],
        '#c:stones',
        'occultism:summon_marid'
    ).dummy("kubejs:ritual_ore_creator").entityToSacrifice("#minecraft:cows")

I appreciate any help.

commented

Strangely enough, the mod itself does not have the unbound afrit implemented, where one would typically sacrifice a cow. Maybe it is an occultism itself bug, or something? I am not too sure.

commented

@desagas I just tested this and I think we are running into an issue with kubejs that the Enigmatica devs also encountered: EnigmaticaModpacks/Enigmatica10#90

Basically if an entity to sacrifice is present, somehow kubejs removes the recipe. I am not sure yet why, I did post this on the kubejs dsicord to figure otu more

commented

@desagas I may just have fixed that Enigmatica issue .. but either way, I now included a sample on how to properly use the entity to sacrifice.

To use that, please update to latest occultism kubejs (1.3.0, now building), as I had to customize something that kube usually does automatically, simply because I do not know how to use it with the kube automatic stuff

commented

The startup example code errors when booting up:
startup.log

I updated to 1.4.0, should I revert to 1.3.0?

commented

The startup example code errors when booting up: startup.log

I updated to 1.4.0, should I revert to 1.3.0?

1.4.0 uses latest kubejs dev (which has a breaking change apparently, I had to change the code I used in 1.3.0)
1.3.0 should work on the version you currently have, and 1.4.0 does not add any new features, they are already in 1.3.0, so that should be the way to go