Magic

Magic

190k Downloads

The "cast" command is not working when using console

martdamp opened this issue ยท 6 comments

commented

The "cast" command doesn't work from console.
When using the command /cast Smoke-Bomb tx 8270 ty 66 tz 8272 tworld world in that world as a player it works fine. When using this command in the console the particle doesn't appear while with debugging it says it did cast the spell

Steps to reproduce:

  • /mvtp world
  • /tp 0 100 0
  • /cast Smoke-Bomb tx 0 ty 100 tz 0 tworld world duration 3000
  • Expected Result: Smoke-Bomb casts.
  • Execute the following command through console:
    /cast Smoke-Bomb tx 0 ty 100 tz 0 tworld world duration 3000
  • Expected Result: Smoke-Bomb casts.
    Actual Result: Nothing seems to happen.

The Smoke-Bomb particle:

Smoke-Bomb:
    icon: feather
    effects:
        cast:
        -   class: EffectSingle
            location: target
            effectlib:
                class: SphereEffect
                particle: CLOUD
                particles: 10
                radius: 0
                radiusIncrease: 0.25
        -   class: EffectSingle
            location: target
            effectlib:
                class: SphereEffect
                particle: CLOUD
                particles: 15
                radius: 0
                radiusIncrease: 0.2
        -   class: EffectSingle
            location: target
            effectlib:
                class: SphereEffect
                particle: CLOUD
                particles: 20
                radius: 0
                radiusIncrease: 0.15
commented

Hey Nathan,

Sorry for not coming back to you earlier.
We have tried some things and using "precast" instead of "cast" did the trick.

commented

When casting from console you also need to specify the source location. Try adding "px 8270 py 66 pz 8272 pworld world".

The p stands for player, this is used to mimic a player casting a spell.

commented

We tried doing that with this command:
/cast Smoke-Bomb tx -125 ty 40 tz -520 tworld AWorld px -100 py 40 pz -500 pworld AWorld
This however didn't result in a particle at that location

commented

So I tried this out myself, and I can't figure out why it wouldn't be working for you. I was wrong about the "p" location parameters, in your case everything is happening at the target, so it doesn't really matter except it might look weird on dynmap.

I was able to "cast Smoke-Bomb tx 0 ty 65 tz 0 tworld world" from the console and see it in-game.

One thing that may help, or at least will make this a little less complex and more consistent, is to add a few parameters:

Smoke-Bomb:
    icon: feather
    effects:
        cast:
        -   class: EffectSingle
            location: target
            effectlib:
                class: SphereEffect
                particle: CLOUD
                particles: 10
                radius: 0
                radiusIncrease: 0.25
        -   class: EffectSingle
            location: target
            effectlib:
                class: SphereEffect
                particle: CLOUD
                particles: 15
                radius: 0
                radiusIncrease: 0.2
        -   class: EffectSingle
            location: target
            effectlib:
                class: SphereEffect
                particle: CLOUD
                particles: 20
                radius: 0
                radiusIncrease: 0.15
    parameters:
        duration: 3000
        range: 1
        allow_max_range: true

That will make it so simply doing "/cast Smoke-Bomb" in-game works for testing, it will appear 1 block in front of you. It may also help your console-casting issue, in case it was being counted as "miss" for some reason. Though I did try different coordinate with cast both above ground and underground, and it seemed to work pretty reliably for me. I hope you can figure it out, let me know if I can help more.

commented

I added the parameters and it didn't appear when run from console. I also tested the command from a different world, the particle didn't appear at the target location.
We are running version 7.0-snapshot.

commented

I'm out of ideas, sorry!

If it works for me using your exact spell configs and command, there's not a whole lot else I can do.