Magic

Magic

190k Downloads

(Feature Request) Default particle for classes/wands

NightScythe1 opened this issue ยท 2 comments

commented

I'm wondering if it would be possible to assign a default particle to certain classes or wands, the same way players can set their 'effect color' for the Redstone/Dust particles in the survival configs.

I ask because I'm currently working on a spell-crafting interface (i.e. letting players create their own entirely custom spells in-game through the use of variables, attributes, & checkrequirements) and the only thing I can see getting in the way currently is letting them choose their spell's effects.

It would be really handy if we could either set default particles the same way 'effect color' works so that by not including a particle in the spell config, it will default to whatever the player has chosen to set their default particle to!

better yet, though likely more complex, would be to see if adding String variables/attributes is possible as asked here, as this could mean defining particle names such as 'flame' or 'end_rod' inside of attributes or variables, to be called back in the spell's config. something like:

  effects:
    cast:
      - particle: $chosen_particle
        location: target
        particle_count: 9
commented

String variables would be a complicated change because variables all go through a math parser which is fundamentally numeric. There is some limited support for substitutions, but I think that only works in parameters (so not for effects).

That said, for the specific use-case of a particle that does exist, at least for wands. (Possibly for classes, too, though I'm honestly not sure offhand- maybe you can try it?)

On a wand config you can have something like this (from my Wolf staff):

effect_particle: ENCHANTMENT_TABLE

Then in any effect block, you can use particle_override like this:

           - class: EffectSingle
             particle_override: particle
             effectlib:
                 class: LineEffect
                 particle: portal

This means that if a wand has an effect_particle set, it will be used in place of any particle parameter. Otherwise the default (in this case portal) will be used.

Hope that helps! I'll leave this open for now, if this doesn't work on classes it probably should, or at least may be able to get it working with some minor changes.

commented

This is pretty much exactly what i was looking for, thank you so much!! I'll run some tests to see if I can work this into the spell-crafting via ModifyProperties and changing the wand's effect_particle. Thanks again!!