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
Element | Description |
---|---|
<projectiles> </projectiles> | Node containing the custom projectile definitions. |
Sub-elements | Value/Children | |
---|---|---|
<projectile> </projectile> | A custom projectile definition. | Projectile Sub-elements |
Projectile Attributes
Attribute | Description | Value | Default |
---|---|---|---|
id | RequiredUnique identifier used to reference this projectile from other places in the XML. | String | |
name | The display name of this projectile, used in "shot by" messages, etc. | String | |
throwable | Items are consumed when using them to shoot this projectile (making them more like grenades than guns). | true/false | true |
projectile | The entity this projectile is materialized as. | Entity Type | Arrow |
power | How powerful this projectile's explosive factor should be. This is only applicable to explosive projectiles. | Number | |
damage | The amount of damage this projectile deals. | Half-hearts | 0.0 |
velocity | The speed at which the projectile moves. | Meters/tick | 1.0 |
click | The click action that fires the projectile. | right ,left ,or both | both |
effects | The potion effects to apply to players hit by this projectile. | Potion Effect | |
destroy-filter | PropertyFilter if/what blocks get destroyed when hit with this projectile. | Filter | never |
cooldown | The minimum time between each firing of this projectile. | Time Period | |
precise | Whether 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/false | true |
Projectile Sub-elements
Element | Description | Value/Children |
---|---|---|
<destroy-filter> | PropertyFilter if/what blocks get destroyed when hit with this projectile. | Filters |
<effect> | A potion effect to apply to players hit by this projectile. | Potion Effects |
<!-- 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.
Element | Description | Value/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