Spell Engine

Spell Engine

8M Downloads

[Fabric 1.19.2] Can't hold right click on any weapon that acts as a spellcasting focus

SPYROHAWK opened this issue ยท 1 comments

commented

I don't know if this is best posted here or under Wizards or Spellblades or whatever, but the SpellEngine changelog is the one that first mentions the new spellbook system, so I'm putting it here.

I'm playing on Fabric 1.19.2 and I've come across a weird interaction, and I am 99% sure it is a side effect of the new spellbook system.

Long story short, you can't hold right click on any weapon that says "Casts spells from equipped spellbook", even if you have no spellbook equipped.

For a more in-depth explanation:

While doing some testing, I noticed I couldn't use any right-click abilities of the weapons from the Simply Swords mod while I had a spellbook equipped, it would just cast the spell (Specifically I was using the Shadowsting sword, but that's not important). But that's fine, that's expected behavior. Right-clicking casts the spell, so as a player you have to choose between being able to use the weapon's active abilities, or having the ability to cast spells. I remove the spellbook from the slot in the inventory, and I can use the weapon properties, no problem. However, this is the reason why I think the following issue is being caused by the spellbook system.

I was doing further weapon testing, and I was looking at the Francisca from the Medieval Weapons mod. I know you can hold right click on this weapon to pull it back, and release to throw it. The same is true for the Javelin and War Axe from the same mod (material type irrelevant). Trying to hold right click causes the weapon to stutter as if you are spam-clicking right click. It does not seem to be limited to throwing, because the Staff of Healing (hold right click and release to shoot a healing orb) has the same issue. In case this is an issue with the mod, I tried other weapons I know have hold-right-click abilities. I tried the Awakened Lichblade, Thunderbrand, and Hearthflame from the Simply Swords mod from before, same issue. Anything that requires holding right click turns into right click spam. I forget which mod and what weapons, but I tried with weapons from another mod that have a hold right click block ability, same issue.

So I tried to find any weapons that don't have this issue. The vanilla Minecraft Trident does not have this issue, it can be thrown like normal, and the same is true for all the tridents from the Impaled mod. Whats the difference with these weapons? Well, none of them have the "Casts spells from equipped Spell Book" text on them.

So here's my guess as to what is going on: When trying to right click any weapon that can be used as a spellcasting focus, it tries to cast a spell from your spellbook. If you have a spellbook equipped, it works and overrides the weapon's right-click ability. If you don't have the runes in your inventory or the spell is on cooldown, it gives you the normal error message and nothing happens. But if you don't have a spellbook equipped, it still tries to cast a spell but sees that it can't, or something, and cancels the right click action. But since you are holding right click, it constantly repeats the process of starting the right click action and stopping it.

The solution would be to make the spellbook system stop looking at the player's right click if they don't have a spellbook in the spellbook slot, so it doesn't even interact with it.

I tested this out with a few different mods, but this is a wide-reaching issue. Any item from any mod with an ability that requires holding right click won't function if spell engine sees it as a valid spellcasting focus item, even if you are not using any spellbook or have never touched any content from spell engine's child mods.

Some more random details:

  • The problem persists even if you have a weapon with no right click ability in your main hand (or just an empty main hand) and the weapon with the right click ability in your offhand.
  • If the main hand weapon has no right click ability and a shield is in the offhand, the shield will function like norma
  • If the main hand weapon has the right click ability and a shield in the offhand, the problem will persist, although I'm not sure if the shield would function under normal behavior anyway
commented

You need to disable assigning spell casting ability to those weapons. (edit config/spell_engine/server.json5)
You have multiple options:
Disable attaching this behaviour automatically to sword like weapons
Put items onto the blacklist regex

The blacklist is a regex. It is matched against item ids. So for example to disable all weapons from banana and apple mods, use: "banana:|apple:"
As the readme shows, individual items can be configured to cast/not-to-cast spells using data files. Wizards, Spellblades etc weapons have this datafile, so those will not be detached.