Option to launch a particle or firework on item use.
mibby opened this issue · 6 comments
Would it be possible to add an option to launch a firework or forced directional particle (or even particle effect/style with EffectLib) on use of an item? I have a special flare gun that players can use and consume, but it's a bit bland when nothing occurs upon interaction.
Flare_Gun:
id: WOODEN_HOE
slot: Arbitrary
durability: 5
name: '&6Ordinary Flare Gun'
lore:
- '&8&m--------&f&l &nGeneral&8 &m--------'
- '&cGun'
- ''
- '&8&m-------------------------'
- ''
- '&7Click to call for extraction.'
- '&7Extraction time: 5 minutes'
- ''
itemflags: death-drops, self-drops, item-store, unbreakable, hide-attributes, disposable
triggers: world-change, join
enabled-worlds: darkzone
commands:
right-click:
- 'console: tellraw @a ["",{"text":"DarkZone","bold":true,"color":"gray"},{"text":" » ","bold":true,"color":"white"},{"text":"Extraction inbound for %player%","color":"gray"}]'
- 'console: bar send %player% Extraction_Inbound... Blue 0 300'
- 'delay: 6000'
- 'console: mvtp %player% e:spawn:-935.5,60,-217.5'
- 'message: &7&lDarkZone &f&l» &7You have been safely extracted from the darkzone.'
commands-cooldown: 310
cooldown-message: '&7&lDarkZone &f&l» &7You have already fired your flare. Please wait for extraction.'
permission-node: 'itemjoin.darkzone.flare'
Sorry for the delayed response, I just arrived back in my home state.
So in an essence, you want the ability to execute a Particle or a EffectLib style particle? In a similar way that the command-sound is executed?
That's correct. That way you could make items a bit more special on use to indicate to the player visual interaction behavior. Such as in my case, a flare gun launching a particle upward.
Okay so, I have officially added support for this as of the latest snapshot.
However, I decided to drop the idea of supporting EffectLib due to the sporadic update schedule.
Instead, I have decided to add my own effect types as well as projectile types, with the option of allowing users to create their own "mini particles".
This is how projectiles will be setup;
commands-particle: PROJTYPE:STARTCOLOR:ENDCOLOR:PATTERN:LIVETIME
Currently, this is how you would define your firework projectile;
commands-particle: FIREWORK:BLACK:RED:BURST:3
Firework defines it being a firework projectile, black is the starting color of the firework explosion, red is the ending color of the firework explosion, the explosion type is burst with a detonation time after 3 seconds of air travel.
Since I will be adding my own effects I will mostly be adding effects that are requested, since they will already be able to create their own "mini particles".
Defining a mini particle would look as such;
commands-particle: PARTICLE:LIVETIME
Let me know if you need anything cleared up.
Added in this snapshot; http://ci.craftationgaming.com/job/ItemJoin/245/
Seems to be working great at first glance. Is there any way to define a following firework launch trail so the trail can be black? (i.e. smoke from a flare launch)
I'll have to experiment with the particle types and definitions you added.
From what I am able to find, according to spigot it is not possible to set the trail as a specific type or color via the FireworkEffect builder, the only options are setting trail to true or false which is just the default trail.
This feature request has been officially added in the release of ItemJoin v5.0.4.
You can grab it here; https://www.spigotmc.org/resources/itemjoin.12661/download?version=295178
Please read the changelog as the documentation has not been updated yet;
https://github.com/RockinChaos/ItemJoin/wiki/Recent-Changes