Power is the core feature set that actually implementing an item function.
Powers execute in pitfall order, and only correctly triggered powers will be executed.
There are some general power properties:
cooldown
Cooldown ticks before next usecost
Cost to durability for each usecondition
Conditions to meet in order to trigger this powertrigger
Triggers of this power
Command to modify power on an item:
/rpgitem power [operation] [item] [params]
Available operations:
add
Add a powerremove
Remove a specific powerlist
List all powersprop
List details about a specific power, or modify it with additional parametersreorder
Re-order a specific power to a new position. This may affect power execution logic
E.g.,
/rpgitem power add mysword rpgitems:beam cost:1 damage:10 ttl:20 triggers:LEFT_CLICK speed:16 particle:CRIT_MAGIC length:24
Applies effect to targets in an area.
amplifier
Effect amplifierduration
Effect durationrange
Radius of areaselfapplication
Whether the effect applies to yourselfname
Effect name, see https://hub.spigotmc.org/javadocs/spigot/org/bukkit/potion/PotionEffectType.html
Let all targets within a range to execute command.
type
Target type, can beentity
player
mobs
r
Target rangerm
Minimum rangefacing
Angle in your direction. value from 0 to 180c
Target countmustsee
There must be no block between you and targetcommand
The command to executepermission
The permission to assign for execution of the command
Deals damage to a range of targets.
range
Maximum target selection rangeminrange
Minimum target selection rangeangle
Angle from your direction, value from 0 to 180count
Number of targets can be attackedincluePlayers
(typo) include players when triggering powerselfapplication
Apply to yourself when triggering powermustsee
There must be no block between you and targetdamage
Damage amount to deal, this is independent with item damage propertydelay
Delay ticks before actual apply damageselectAfterDelay
When delay is not 0, set this to false to select target on use, so that target will be damaged even it's out of range.firingRange
firingLocation
Define location of AOE center, can beSELF
orTARGET
castOff
WhenfiringLocation
isTARGET
and delay is not 0, set this to true to set center on use before delay
Damage boost when flying.
Deprecated. Use Projectile
.
Trigger power from other items.
Pull or push entity.
radius
Radius to select targetmaxSpeed
Maximum speed to pull/push entityduration
Duration time to pull/push entityattractingTickCost
Cost per tick for using this powerattractingEntityTickCost
Cost per tick per entity for using this powerattractPlayer
Whether it will pull/push playerfiringLocation
Can beSELF
orTARGET
firingRange
Fire a beam made by particle. This is by far the most complex and powerful power in RPGItems.
length
Maximum beam lengthttl
Time to live ticksparticle
Particle type, see https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Particle.htmlmode
Can beBEAM
(run in 1 tick) orPROJECTILE
(run in multiple ticks)pierce
Number of targets that can be pierced throughignoreWall
Ignore wall when flying, defaults totrue
damage
Damage deal when contact, this is independent with damage property in item configspeed
Beam flying speed, block per secondoffsetX
particle offsetXoffsetY
particle offsetYoffsetZ
particle offsetZparticleSpeed
particle speed parameterparticleDensity
how many particle spawn dots in one block spacecone
Angle from your direction to fire discrete beamshoming
Radius for hominghomingAngle
Angle from your direction to select targethomingRange
Block distance to select targethomingMode
Can beONE_TARGET
Lock on single targetMULTI_TARGET
Change target after last hitMOUSE_TRACK
Lock on nearest target of mouse aim
homingTarget
Can beMOBS
/ENTITY
/PLAYER
ticksBeforeHoming
Ticks before homing pathbeamAmount
How many beam will be fired in a single runburstCount
How many beam will be fired in a single triggerburstInterval
Ticks between next burstbounce
How many times the beam will bounce off wall, requireignoreWall
tofalse
hitSelfWhenBounced
Beam may hit yourself when bounce off wallgravity
Gravity of beam, can be negative (trace goes up)extraData
Color ofREDSTONE
particle, in format ofr,g,b,size
. E.g., extraData:`51,204,255,0.35` for a cyan slim beamspeedBias
Expression to control the flying speed. E.g.,4+x*10*t
behavior
Controls the beam behaviorinitialRotation
firingLocation
Can beSELF
orTARGET
effectOnly
Only act as effect, will not trigger HIT eventfiringR
Polar coordinates parameterfiringTheta
Polar coordinates parameterfiringPhi
Polar coordinates parameterfiringRange
castOff
Cancels bow arrow. Arrow will not be consumed and no arrow is fired. Often used on bows with other powers.
Damage boost when sprinting.
percentage
Damage increase percentagespeedPercentage
Damage increase percentage by speedsetBaseDamage
Set to true to use dynamic damage as base, otherwise use damage property in item configcap
Maximum damage cap
Execute command on use.
command
Command to execute. Use ` to quote with space, e.g.,command:\
minecraft:give {player} stone``display
Message to display in lorepermission
Permission to assign just for executing the command
Variables available in command:
{player}
the user's name{player.x}
the user's X coordinate{player.y}
the user's Y coordinate{player.z}
the user's Z coordinate{player.yaw}
the user's yaw coordinate{player.pitch}
the user's pitch
Execute command on hit.
command
Command to execute.permission
Permission to assign just for executing the commandminDamage
Minimum damage to deal in order to trigger this power
Variables available in command:
{entity}
the target's name{entity.uuid}
the target's UUID{entity.x}
the target's X coordinate{entity.y}
the target's Y coordinate{entity.z}
the target's Z coordinate{entity.yaw}
the target's yaw coordinate{entity.pitch}
the target's pitch
Consume item on use.
Consume item on hit.
Deals critical hit.
chance
Chance to trigger the powerbackstabchance
Chance to backstabfactor
Damage multiplierbackstabFactor
Damage multiplier when backstabsetBaseDamage
Set to true to use dynamic damage as base, otherwise use damage property in item config
A chance to kill target and execute command.
Deflect incoming projectile.
Execute command with delay.
Power dummy do nothing but provides a bunch of universal options to help you make item logic execution clean.
checkDurabilityBound
Check durability bound before trigger. Once durability out of bound the dummy will not be triggered.costByEnchantment
Calculate cost by Enchantments, needed fordoEnchReduceCost
doEnchReduceCost
Enchantment like durability can reduce cost (chance not to cost)enchCostPercentage
Percentage not to cost for each enchantment levelenchantmentType
Enchantment name likeunbreaking
(default value)costbyDamage
Cost value by damagecooldownKey
When there are multiple dummy power, set a unique key string to make cooldowns independentsuccessResult
Action after this dummy is successfully executed, defaults toOK
which will continue with next power.costResult
Action after cost. Defaults toCOST
which deals the cost and continue with next power. Set toABORT
to break and abort the whole process,OK
to ignore the cost and continue with next power.cooldownResult
Action after cooldown. Defaults toCOOLDOWN
which break execution of dummy but continue with next power. SetABORT
to break and abort the whole process,OK
to ignore cooldown and continue with next power.showCDwarning
If you wish not to show cooldown warning message, set tofalse
.globalCooldown
Set the cooldown to global.
Use PowerDummy to disbale cooldown message, unify and control cooldown / cost.
You should already acknowledge that RPGitems execute powers based on trigger, like RIGHT_CLICK
or LEFT_CLICK
and activate power one by one in a pitfall. So if you have an item with a list of powers like:
- PowerProjectile, trigger
LEFT_CLICK
- PowerBeam, trigger
RIGHT_CLICK
- PowerSound, trigger
RIGHT_CLICK
- PowerParticle, trigger
LEFT_CLICK
When you do left click, only 1 and 4 will be activated. The item firstly shoot a projectile and then play a particle, but in a single tick.
Now if you want to cost 1 durability on each left click use, with 20 ticks cooldown and do not wish to show the duplicated cooldown message, you can add PowerDummy at first place, and set cooldown:20 cooldownKey:left cooldownResult:ABORT cost:1 showCDWarning:false triggers:LEFT_CLICK
. You should also set PowerProjectile and PowerParticle's cost
and cooldown
to 0, indicating you do not need them and only using PowerDummy to control everything.
RPGitem will first check PowerDummy, and if it's in cooldown then abort the whole execution process, which means projectile and particle powers will not be activated. If it's not cooling down and all conditions (if any) are met, cost 1 then continue with power execution (fire a projectile and play particle).
Similarly, if you set costResult
to ABORT
, when the item durability less than its lower bound, the power execution will be aborted.
Please note dummy power options is effective only with correct trigger. If you set dummy with RIGHT_CLICK
trigger, it will not affect any power with triggers other than RIGHT_CLICK
.
Operates economy functions.
Make enchantment boost damage.
mode
Can beADDITION
orMULTIPLICATION
amountPerLevel
Boost percentage per enchant level, 1 = 100%enchantmentType
See https://hub.spigotmc.org/javadocs/spigot/org/bukkit/enchantments/Enchantment.htmlsetBaseDamage
Set to true to use dynamic damage as base, otherwise use damage property in item config
Set damage based on expression.
Cause explosion on use.
Ignite target.
Deprecated. Use Projectile
.
Shoots a bunch of fire.
Restores saturation level.
Summon a forcefield to trap or block target.
Catch and throw entity.
Projectiles will homing to target.
Damage boost when hit target head.
Shoots ice and form an ice block.
Knockup target on hit.
Gain health on hit.
Summon lightning strike.
Ride on entity.
Ignore immutable tick.
Summon ParticleBarrier to reduce damage taken and give you power.
Plays particle on use or hit.
Plays particle when holding or wearing.
Applies potion effect on hit.
Applies potion effect to user.
Applies potion effect when holding or wearing.
Fires projectile with many options.
isCone
if the projectile fires in a cone. Defaults tofalse
gravity
if the projectile affected by gravity. Defaults totrue
range
cone angle from your directionamount
amount of projectile in a single runspeed
projectile flying speedburstCount
how many projectiles will be firedburstInterval
ticks between next burst runsetFireballDirection
fireball will not float if set totrue
yield
may cause explosion, defaults tofalse
isIncendiary
may cause fire, defaults tofalse
projectileType
type of projectile, can bearrow
snowball
fireball
smallfireball
llamaspit
shulkerbullet
dragonfireball
trident
skull
suppressArrow
Cancels arrow when firing from bow, but arrow will still be consumedapplyForce
apply bow force for arrow and fireball, affects speedfiringLocation
Can beSELF
orTARGET
firingR
Polar coordinates parameterfiringTheta
Polar coordinates parameterfiringPhi
Polar coordinates parameterfiringRange
castOff
Force target wear a pumpkin head.
Shoots colorful wool.
Deals real damage, ignores armor.
Consume material to restore (or cost) durability.
durability
Durability restored (or cost) per each repair materialdisplay
Message displayed in lorematerial
Repair material. Can beHAND
to use item hold in mainhand.isSneak
Require sneak to triggermode
Can beDEFAULT
,ALLOW_OVER
andALWAYS
allowBreak
defaults totrue
abortOnSuccess
abort and break execution after successfully triggered (repaired)abortOnFailure
abort and break execution after failed to repair (e.g., no material)customMessage
Message to display in chatamount
Maximum material amount to consume in each triggershowFailMsg
Show repair failed message or not. Default totrue
A better totem replacement.
Summon a wave to blow target to sky.
Operates on scoreboard.
Shoots shulkerbullet that homing to target.
Hook to specific block.
Plays sound on use or hit.
Cause targets not to move or teleport.
Shoots TNT.
Teleport for a distance.
Throw entity.
Deprecated. Use Projectile and PotionHit
Shoots some torches to light up a place.
Shoots a translocator and swap your position.