Spell Engine

Spell Engine

8M Downloads

Request for Impact Type: Command

AetheriMC opened this issue ยท 4 comments

commented

Hello again. Would it be possible to include an impact type called "Command", which would allow for a provided command to be executed on the entity(ies) affected by a spell?

This would allow for some seriously unique spell creation without the need to include every possible effect within the Spell Engine API. An example spell that could be created this way would be Enlarge or Shrink, which could be created using a command from the mod Pehkui. If you're unfamiliar with Pehkui, this is a mod that allows for the modification of entity sizes, movement speed, enemy detectability distance, etc., easily with commands. Adding this feature would prevent you from having to include in the code special features like size alteration (at least, right away), and would allow users to instead use mods which are already independently functional.

Just a thought! Thank you again for the effort you've put into this mod so far. Magic is sorely lacking in Minecraft, and even with the other mods available, nothing has felt quite so fitting with vanilla as yours has.

commented

Hey!

I had a similar idea, I was referring to it as CUSTOM impact type.
The idea is that this case of the execution would post an event via a Java interface (similar to how you can subscribe to Fabric API events), and it would pass lots of arguments for custom execution.

Does this sound similar to your request?

commented

Yes and no! ๐Ÿ˜„ The idea is similar obviously, but a little more restricting for anyone unfamiliar with how to utilize Fabric APIs (myself included).

Specifically, (and I'm looking at the Origins mod as inspiration here) I'm thinking of an impact type that simply executes as the entity that's hit, a minecraft command as provided in the spell .json, essentially executing that command from within the game with the same results as if it were typed out manually.

For a very basic example, if the command were "/tp ~ ~50 ~", then an entity impacted with this spell would be teleported 50 blocks above its current location.

commented

Ohh, yeah sorry, your approach is way more specific.
Unfortunately this has lots of semantically unresolved strings attached, that is most likely not possible to resolve.
Every impact action needs to have:

  • intent (hostile/helpful)
  • apply conditions
  • result of applying (success or failure)

This is not easy to integrate, because Minecraft commands go in a Fire and Forget style.

commented

Ah, ok. That's unfortunate but I completely understand. At least with the custom impact type, there's an opportunity to include custom executions for those that understand the framework. I look forward to your updates!

Thank you again!