Projectile - DragonSurvivalTeam/DragonSurvival GitHub Wiki
A projectile defines all of the characteristics of a custom projectile. In Dragon Survival, you can either define a arrow projectile (behaves similarly to an arrow) or a ball projectile (behaves similarly to a fireball, e.g. the ghast fireball).
Projectiles are part of the data pack directory structure, highlighted below:
datapack name.zip ├──
pack.mcmeta ├──
data ├──
namespace ├──
dragonsurvival ├──
projectile_data ├──
<name>.json
This object is used by the following objects:
This object references the following objects:
General data that is used for both projectile types.
{
"name": [ResourceLocation] // [Mandatory] || The name of the projectile.
"entity_hit_condition": [Predicate] // [Optional] || The conditions under which a projectile is allowed to hit an entity.
"ticking_effects": [ProjectileTargeting] // [Mandatory] || The list of ticking effects that this projectile applies.
"common_hit_effects": [ProjectileTargeting] // [Mandatory] || The effects that apply when hitting an entity or block.
"entity_hit_effects": [ProjectileEntityEffect] // [Mandatory] || The effects that apply when hitting an entity.
"block_hit_effects": [ProjectileBlockEffect] // [Mandatory] || The effects that apply when hitting a block.
}
Data used for the arrow type projectile.
{
"texture": [LevelBasedResource] // [Mandatory] || The texture to use for the projectile, per level of the ability. Textures are in assets/<namespace>textures/entity/projectiles.
"piercing_level": [LevelBasedValue] // [Optional] || How many entities it can pierce through. 0 if empty.
}
Data used for the ball type projectile.
Specific data for how the ball projectile behaves.
{
"width": [LevelBasedValue] // [Mandatory] || The width of the projectile.
"height": [LevelBasedValue] // [Mandatory] || The height of the projectile.
"max_bounces": [LevelBasedValue] // [Optional] || The max number of bounces for the projectile. Defaults to 0.
"max_lingering_ticks": [LevelBasedValue] // [Optional] || The number of ticks the projectile lingers (when it hits something, it will "linger" at the hit location for this time period.
"max_movement_distance": [LevelBasedValue] // [Mandatory] || The max distance the projectile can move before it automatically destroys itself.
"max_lifespan": [LevelBasedValue] // [Mandatory] || The max lifespan the projectile has (in ticks) before it automatically destroys itself.
}
{
"resources": [LevelBasedResource] // [Mandatory] || The name of the resource to use for the projectile, per level of the entity. The same name is reused for both the animation and texture. Textures are in assets/<namespace>textures/entity/projectiles. Animations are in assets/<namespace>/animations/projectiles.
"trail_particle": [ParticleType] // [Optional] || The type of particle to use for the particle trail the projectile emits.
"on_destroy_effects": [ProjectileTargeting] // [Optional] || What happens when the projectile is destroyed.
"behaviour_data": [BehaviorData] // [Mandatory] || Various pieces of special projectile behavior (lingering, bounces, size, etc..)
}
{
"general_data": [GeneralData] // [Mandatory] || General projectile data.
"type_data" [Either GenericBallData or GenericArrowData] // [Mandatory] || Specific projectile data.
}