-
Notifications
You must be signed in to change notification settings - Fork 921
Custom Potato Cannon Projectile Types
(For Create 0.3.2e & f)
Custom potato cannon projectile types can be added via a datapack. Before 0.3.2e, types could only be added through code, but now a datapack can also be used. At this time, adding a type through code allows more customizability and control, however.
Adding a custom type is quite simple - just set up a basic datapack (more information here) and add some files under the data/[namespace]/potato_cannon_projectile_types
directory. Files must end in .json
but can be located in any sub-directory, as long as the full path does not violate Minecraft's ResourceLocation path check. The full specification for these JSON files can be found in the table below.
Key | Value Type | Default Value | Description |
---|---|---|---|
items |
string array | N/A | Each string represents the namespaced identifier of an item that will have this type applied to it. |
reload_ticks |
integer | 10 |
The amount of ticks that must pass before a projectile can be fired again. |
damage |
integer | 1 |
The amount of damage projectiles deal to entities. |
split |
integer | 1 |
The amount of projectiles the original projectile splits into after being fired. |
knockback |
float | 1 |
How far entities get knocked back after getting hit by a projectile. |
drag |
float | 0.99 |
How fast the projectile loses velocity. |
velocity_multiplier |
float | 1 |
How fast the projectile travels after being fired. |
gravity_multiplier |
float | 1 |
How strongly the projectile is affected by gravity. |
sound_pitch |
float | 1 |
The pitch of the firing sound. |
sticky |
boolean | false |
If the projectile sticks to an entity after hitting it. |
Custom types will always override builtin types (types added through code) but behavior is undefined if multiple custom types define the same item. In the future, custom types defining the same item will override each other in alphabetical order.
Custom types cannot define block or entity interactions or have a render mode other than billboard. However, this functionality will be added eventually.
data/example/potato_cannon_projectile_types/fish.json
{
"items": [
"minecraft:cod",
"minecraft:salmon"
],
"reload_ticks": 5,
"knockback": 2,
"velocity_multiplier": 1.2,
"sticky": true
}
data/example/potato_cannon_projectile_types/material_blocks.json
{
"items": [
"minecraft:gold_block",
"minecraft:iron_block",
"minecraft:diamond_block",
"minecraft:emerald_block"
],
"reload_ticks": 30,
"damage": 20,
"knockback": 5,
"drag": 1.5
}