Skip to main content

Custom Projectiles

Custom projectile types can be defined and applied to items in Kits. These items effectively become either weapons that shoot the custom projectile, or the item form of the custom projectile itself.

Projectiles Element

ElementDescription
<projectiles> </projectiles>Node containing the custom projectile definitions.
Sub-elementsValue/Children
<projectile> </projectile>A custom projectile definition.Projectile Sub-elements

Projectile Attributes

AttributeDescriptionValueDefault
idRequiredUnique identifier used to reference this projectile from other places in the XML.String
nameThe display name of this projectile, used in "shot by" messages, etc.String
throwableItems are consumed when using them to shoot this projectile (making them more like grenades than guns).true/falsetrue
projectileThe entity this projectile is materialized as.Entity TypeArrow
powerHow powerful this projectile's explosive factor should be.
This is only applicable to explosive projectiles.
Number
damageThe amount of damage this projectile deals.Half-hearts0.0
velocityThe speed at which the projectile moves.Meters/tick1.0
clickThe click action that fires the projectile.right,
left,
or both
both
effectThe potion effects to apply to players hit by this projectile.Potion Effect
destroy-filterPropertyFilter if/what blocks get destroyed when hit with this projectile.Filternever
cooldownThe minimum time between each firing of this projectile.Time Period
preciseWhether the path of a thrown projectile should be precise in hitting a target.
This is only applicable if the projectile is Fireball, LargeFireball, SmallFireball, or WitherSkull.
true/falsetrue
<!-- Create the projectile "lazer" -->
<projectiles>
<projectile
id="lazer"
name="lazer"
projectile="Snowball"
velocity="3.5"
damage="50"
throwable="false"
cooldown="5s"/>
</projectiles>
<!-- Apply the projectile to an item -->
<kits>
<kit id="lazer-kit">
<item projectile="lazer" name="`alazer gun" material="stick"/>
</kit>
</kits>

Modifying Bow Projectiles

Bows can be modified to shoot a different projectile at a custom speed. The PGM plugin will calculate the damage the projectile does using the same formula as Minecraft does for arrows. This means that a flying fish with a velocity of 40 will almost certainly kill you. Projectiles can also have custom potion effects which are applied to the target when it is hit.

Note: You can currently only modify all bow projectiles, this means no normal and custom bow at the same time.

ElementDescriptionValue/Children
<modifybowprojectile>
</modifybowprojectile>
Node containing the modify bow projectile settings.Bow Projectile Sub-elements
Sub-elements
<projectile> </projectile>The entity to use as the bows projectile.Projectile Type
<velocityMod> </velocityMod>The velocity modifier of the bows projectile.Number
<potion> </potion>A potion effect to apply to players hit by the bow projectile.Potion Effect
<pickup-filter> </pickup-filter>A filter to determine which players can pick up arrows.Filter

Examples

<modifybowprojectile>
<projectile>EnderPearl</projectile>
<velocityMod>2.5</velocityMod>
<!-- Projectile potion effect -->
<potion duration="5" amplifier="1">poison</potion>
</modifybowprojectile>
<modifybowprojectile>
<potion duration="8" amplifier="1">wither</potion>
</modifybowprojectile>

Custom Projectile Types

All of the following projectiles in this table are guaranteed to work. Some projectiles such as WitherSkull travel very fast by default and may need <velocityMod> to reduce the speed.

Working Entity Types
Arrow
Boat
Egg
EnderPearl
FallingBlock
Fireball
Firework
LargeFireball
SmallFireball
Snowball
ThrownExpBottle
WitherSkull
TNTPrimed

Copied from: mrapple/Bukkit Entity Spawning.md