-
-
Notifications
You must be signed in to change notification settings - Fork 4
Cannon Design
While there are some default cannon designs you can build and use, you can also create you own cannons. A cannon design is made of 2 key components:
The files will have a different extension, but to let cannons understand that they are the same cannon, hey must have the same name, said name will be also indentify the cannon type and will be often referred to as designID, so for a cannon with id classic we will have:
- classic.yml
- classic.schematic
Generally you would want to first make the design then the schematic, as the second one depends on data defined in the .yml file
While I try to mantain the old documentation, only for the classic.yml, in a comment format, this will be the most reliable source soon.
Let's check the classic cannon design to understand better
general:
#name of the cannon. This will show of on the cannon sign - therefore keep it short
designName: "Classic"
#This will be used for messages and will replace CANNON in all messages. (e.g. You created a classic cannon)
messageName: "classic cannon"
#a short description of the cannon
description: "A small cheap cannon - nothing fancy. Will break very easily since it is made out of wool."
#last user of cannon becomes to it's owner (cannon is public)
lastUserBecomesOwner: false
signs:
# OLD, part of this was extracted into a separate addon as now the signs are kind of problematic, you can still use it though
isSignRequired: false
ammunition:
#what the gunpowder is called
gunpowderName: gunpowder
#what item is used as gunpowder (minimum is id:data. Named items id:data;displayName;lore1;lore2;....)
#'minecraft:gunpowder;§rGunpowder'
gunpowderType: 'minecraft:gunpowder'
#does this cannon need gunpowder. If false you can directly load the projectile
needsGunpowder: true
#gunpowder will be removed from inventories. If false you have to click the cannon until it is reloaded
gunpowderConsumption: true
#if false the cannons will not remove the projectile form the inventory but you still need a projectile
projectileConsumption: true
#if true, no item is removed from the players inventory
ammoInfiniteForPlayer: false
#if true, the cannons does not consume ammunition for autoreloading with redstone
ammoInfiniteForRedstone: false
#whether the cannon can reload from a chest
autoreloadRedstone: true
#after firing the projectile are usually gone, but you can set this to false to keep the cannon loaded. Just load the cannon once and it stays loaded until you break it.
removeChargeAfterFiring: true
#when set the gunpowder will taken from your inventory when a projectile is loaded, no loading of gunpowder required
autoloadChargeWhenLoadingProjectile: false
#after creating a cannon it will be preloaded with the maximum amount of gunpowder and the default projectile (first in the list)
preloaded: false
barrelProperties:
#maximum gunpowder that can be loaded in the cannon
maxLoadableGunpowder: 3
#how much faster the loaded projectile will fired for each gunpowder loaded
multiplierVelocity: 1.0
#the angle of which a fired projectile spreads when fired. Basically the lower this is, the more accurate the cannon is
spreadOfCannon: 1.0
timings:
#how long anyone near the cannon without a helmet will be confused when the cannon is fired
blastConfusion: 5.0
#the delay in seconds between when someone fires a cannon and when the actual projectiles fired from the cannon
fuseBurnTime: 1.0
#fuseBurnTime is multiplied with this with this factor. 0 means the burn time is always the same while 1 it can change vary from 1x to 2x the fuseBurnTime
fuseBurnTimeRandomness: 0.5
#the time in seconds before the cannon can be fired again. Outdated due to heat management
barrelCooldownTime: 0.0
#time to load gunpowder and projectile for autoreload
loadTime: 3.0
angles:
#used to adjust in what direction a projectile is fired from a cannon. adjust this if your cannon is firing sideways or at itself
defaultHorizontalFacing: west
#the default angle vertical angle which the cannon aims at when built. this is good for mortars and similar upwards firing weapons
defaultVerticalAngle: 0.0
#min and max horizontal angles determine how far to the left and right the cannon can be aim
maxHorizontalAngle: 45.0
minHorizontalAngle: -45.0
#min and max vertical angles determine how far upwards or downwards the cannon can be aimed
maxVerticalAngle: 45.0
minVerticalAngle: -45.0
#if the cannon is on a ship the angles might be smaller, only used by movecraft only if a certain tag is specified, for more info check https://github.com/Intybyte/Cannons/wiki/Hooks-&-Integrations
maxHorizontalAngleOnShip: 10.0
minHorizontalAngleOnShip: -10.0
maxVerticalAngleOnShip: 45.0
minVerticalAngleOnShip: -45.0
#each change of the angles will change angle by this amount
angleStepSize: 0.5
#rougher steps to change cannon direction more quickly
largeStepSize: 2.0
#how fast the cannons can be turned in seconds (fastest is 0.05s)
angleUpdateSpeed: 0.1
#a message with the new angles is displayed to the user while aiming
angleUpdateMessage: false
#the impact predictor will show the impact location of a loaded cannon
impactPredictor:
#enable the impact predictor
enabled: true
#the impact location will be shown after the last angle change of the cannon [s]
delay: 0.5
#update rate. How often the impact predictor will be calculated per second
update: 0.2
#sentry mode allows the gun to search and destroy targets automatically.
sentry:
#this gun is a sentry gun. It will operate on its own.
isSentry: false
#does this fire like a mortar (indirect - from above) or like a cannon
indirectFire: false
#at which distance the sentry will stop firing because it is too close
minRange: 5
#at which distance the sentry will detected enemies
maxRange: 50
#how acurate can the final angle be calculated. The smaller the better
spread: 0.5
#how long the cannon updating firing solutions. Higher delays result in worse tracking of a moving target. [s]
update: 1.0
#the cannon will switch to the next target after some time [s]
swapTime: 10.0
#enables the linking of several cannons together. Default is limited to the same design
linkCannons:
#enables the feature to link cannons
enabled: false
#cannons can be link if they are closer than the given range to the operated cannons in a box shape
distance: 40
heatManagement:
#if heat management is used or not
enabled: true
#if true the cannon will refuse to fire if the cannon temperature after firing would be higher than critical
automaticTemperatureControl: true
#touching a hot cannon will hurt (in full hearts)
burnDamage: 0.0
#touching a hot cannon will slow you (in seconds)
burnSlowing: 10
#how much firing one gunpowder will increase the temperature of the barrel
heatIncreasePerGunpowder: 10.0
#heat dissipation time coefficient. Smaller time coefficient means it cools down faster
coolingTimeCoefficient: 10.0
#how much cooling with the cooling item (config.yml e.g. water bucket) will cool the cannon
coolingAmount: 50.0
#searchs for cooling items in chests and cools the cannon if the cannon temperature above the warning temperature
automaticCooling: true
#the barrel is hot and you will notice this effect
warningTemperature: 60.0
#the barrel damage is critical and the cannon can explode
criticalTemperature: 150.0
#if the cannon exceeds this temperature it will explode
maximumTemperature: 300.0
#items to cool down a cannon (minimum is minecraft:material. Named items minecraft:material;displayName;lore1;lore2;....)
coolingItems:
- 'minecraft:water_bucket'
- 'minecraft:ice'
- 'minecraft:snow_block'
#items which are returned after cooling the cannon. The order is the same like above.
#setting a item to minecraft:AIR means it will only remove one item instead of replacing the item minimum is minecraft:material. Named items minecraft:material;displayName;lore1;lore2;....)
coolingItemsUsed:
- 'minecraft:bucket'
- 'minecraft:air'
- 'minecraft:air'
#cannon can be loaded with more gunpowder, but might explode after firing
overloading:
#cannon can explode if overloaded with gunpowder
#chance = chanceInc * ((all loaded gunpowder - maximum loadable gunpowder without overloading) * ChanceOfExplosionPerGunpowder)^Exponent
enabled: true
#in real mode cannon can also explode when not overloaded
#chance = chanceInc * (all loaded gunpowder * ChanceOfExplosionPerGunpowder)^Exponent
realMode: false
exponent: 2
chanceInc: 1
maxOverloadableGunpowder: 1
chanceOfExplosionPerGunpowder: 0.1
#the explosion chance will be multiplied by cannon's temperature / maximumTemperature
dependsOfTemperature: true
#loaded gunpowder = 3 normal + 1 overloaded
#exploding change = 1 * ((3+1)*0.1)^2 = 16%
#For example, if cannon have:
#Mode = 1
#Exponent = 2
#ChanceInc = 1
#MaxLoadableGunpowder = 3
#MaxOverloadableGunpowder = 3
#ChanceOfExplosionPerGunpowder = 0.1
#Loaded gunpowder = 5 (3 normal + 2 overloaded)
#Chance of explosion = 1*((5-3)*0.1)^2 = 0.04 = 4%
#=================================
#Another example:
#Mode = 1
#Exponent = 2
#ChanceInc = 1
#MaxLoadableGunpowder = 3
#MaxOverloadableGunpowder = 3
#ChanceOfExplosionPerGunpowder = 0.1
#Loaded gunpowder = 6 (3 normal + 3 overloaded)
#Chance of explosion = 1*((6-3)*0.1)^2 = 0.1 = 10%
#=================================
#Another example:
#Mode = 1
#Exponent = 1
#ChanceInc = 0.1
#MaxLoadableGunpowder = 3
#MaxOverloadableGunpowder = 3
#ChanceOfExplosionPerGunpowder = 0.1
#Loaded gunpowder = 6 (3 normal + 3 overloaded)
#Chance of explosion = 0.1*((6-3)*0.1)^1 = 0.03 = 3%
#=================================
#Another example:
#Mode = 1
#Exponent = 3
#ChanceInc = 4
#MaxLoadableGunpowder = 3
#MaxOverloadableGunpowder = 3
#ChanceOfExplosionPerGunpowder = 0.1
#Loaded gunpowder = 6 (3 normal + 3 overloaded)
#Chance of explosion = 0.4*((6-3)*0.1)^3 = 0.108 = 10.8%
#=================================
#Another example:
#Mode = 2
#Exponent = 3
#ChanceInc = 1
#MaxLoadableGunpowder = 3
#MaxOverloadableGunpowder = 3
#ChanceOfExplosionPerGunpowder = 0.1
#Loaded gunpowder = 6 (3 normal + 3 overloaded)
#Chance of explosion = 1*(6*0.1)^3 = 0.216 = 21.6%
economy:
# default types are cannons:vault and cannons:empty, addons can define their own and you can use them here
type: "cannons:vault"
#the money the is withdrawn from your account when you build a cannon. If you have not enough - no cannon will be created
buildingCosts: 100.0
#how much money you receive if your cannon was deconstructed
dismantlingRefund: 90.0
#how much money you receive if your cannon was destroyed
destructionRefund: 10.0
realisticBehaviour:
#whether a player has to right click while holding the firing item (e.g flint and steel) for the cannon to be fired
isFiringItemRequired: false
#firing a cannon produced soot (dirt) which needs to be cleaned. Cleaning is necessary if soot>=1
sootPerGunpowder: 0.1
#created cannon will have this amount of soot (0 to disable this feature)
startingSoot: 10
#after loading a projectile it is necessary to push the projectile against the gunpowder
projectilePushing: 2
#the cannon move one block back after firing (not implemented yet)
hasRecoil: false
#whether you have to load the cannon from the same place the projectile is fired (aka muzzle loading) (not implemented yet)
isFrontloader: false
#whether the whole cannon can be rotated 90 degrees (not implemented yet)
isRotatable: false
#whether the cannon can be used with fire missions to bombarded a certain location (not implemented yet)
supportsFireMission: false
#the mass in kilogram of a cannon is important for moving objects e.g. ships
massOfCannon: 100
#cannon explodes if a loaded cannon is destroyed. Explosion power 4 (like tnt) and 0 to disable it. Will be scaled with the loaded gunpowder.
explodingLoadedCannon: 2.0
#fire after loading projectile with the time delay given by the fuse time. Sneaking will stop immediate firing.
fireAfterLoading: false
#dismantling takes some time (fits to the sound) [s]
dismantlingDelay: 1.75
permissions:
#all the permissions required for a player to use certain parts of the cannon
#more information can be found here: http://dev.bukkit.org/bukkit-plugins/cannons/pages/installation-and-configuration/cannons-2-0-and-up/permissions/
build: cannons.player.build
#for deconstructing a cannon you need to be the owner and have this permission
dismantle: cannons.player.dismantle
#give the cannon a new name
rename: cannons.player.rename
#permission for loading gunpowder and projectiles
load: cannons.player.load
#permission for firing a cannon
fire: cannons.player.fire
#permission for aiming with a cannon
adjust: cannons.player.adjust
#permission to used the ramrod (stick) to clean and push the projectile
ramrod: cannons.player.ramrod
#the cannon will follow the looking direction of the player if the aiming item is used (default: clock)
autoaim: cannons.player.autoaim
#player can add himself as an observer of a cannon with the cmd: '/cannons observer'
observer: cannons.player.observer
#not implemented yet
targetTracking: cannons.player.tracking
#if a player has no permission for redstone, it is not possible to wire a cannon with redstone or uses torches.
#firing a prewired cannon however is possible.
redstone: cannons.player.redstone
#this player can use a thermometer to measure the temperature of a cannon (default item for thermometer is a gold nugget)
thermometer: cannons.player.thermometer
#cannon will autoreload if the player is sneaking and fires the cannon.
#The ammunition comes from the chest next to the cannon
autoreload: cannons.player.autoreload
#how much better the player can handle the cannon.
#possible values are cannons.player.spreadmultiplier.1 - cannons.player.spreadmultiplier.10 for a multiplier of 0.1 - 1.0
spreadMultiplier: cannons.player.spreadmultiplier
accessRestriction:
#whether only the owner of the cannon can use it or not (not implemented yet)
ownerOnly: false
allowedProjectiles:
#these are the list of projectiles a cannon can fire. The projectiles are taken from the config files in the projectiles folder.
#they do not have to be named after an in-game item and can be named anything.
#make sure the name matches the name of the config file of the projectile you want this cannon to be able to fire. the .yml part does not need to be included
- cobblestone
- diamond
- canistershot
- enderpearl
- tnt
- firework1
sounds:
#sound effects for this cannon.
#You can enter new sounds in the following way 'NAME:VOLUME:PITCH'. Like 'IRON_GOLEM_WALK:1:0.5'
#NAME: You can use minecraft sounds (block.anvil.hit), custom resource sound packs, or bukkit sound names (https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Sound.html)
#VOLUME: How far you will hear this sound
#PITCH: How fast it is played. (0.5-2)
#USE 'none:1:1' to disable this sound
#creating a new cannon
create: 'BLOCK_ANVIL_LAND:1:0.5'
#paying the cannon fee of a new cannon
selected: 'BLOCK_ANVIL_LAND:1:2'
#destroying a cannon
destroy: 'ENTITY_ZOMBIE_ATTACK_IRON_DOOR:1:0.5'
#dismantling a cannon
dismantle: 'BLOCK_ANVIL_USE:1:0.5'
#changing the angle of a cannon
adjust: 'ENTITY_IRON_GOLEM_STEP:1:0.5'
#fuse igniting sound when firing
ignite: 'ENTITY_TNT_PRIMED:5:1'
#firing sound
firing: 'ENTITY_GENERIC_EXPLODE:20:1.5'
#loading gunpowder
gunpowderLoading: 'BLOCK_SAND_HIT:1:1.5'
#overloading gunpowder
gunpowderOverloading: 'BLOCK_GRASS_HIT:1:1.5'
#cooling a cannon
cool: 'BLOCK_FIRE_EXTINGUISH:1:1'
#smoke effects for touching a hot barrel
hot: 'BLOCK_FIRE_EXTINGUISH:1:1'
#cleaning with the ramrod
ramrodCleaning: 'BLOCK_SNOW_HIT:0.5:0'
#cleaning with ramrod done
ramrodCleaningDone: 'BLOCK_SNOW_HIT:0.5:1'
#pushing projectile into the barrel
ramrodPushing: 'BLOCK_STONE_HIT:0.5:0'
#pushing projectile done
ramrodPushingDone: 'BLOCK_ANVIL_LAND:0.5:0'
#measuring the cannon temperature with a thermometer
thermometer: 'BLOCK_ANVIL_LAND:1:1'
#enabling the aiming mode with a clock
enableAimingMode: 'NONE:1:1'
#disabling aiming mode
disableAimingMode: 'NONE:1:1'
constructionBlocks: ... # Explained in schematic sectionImportant
Sometimes when defining custom item names and lore, it might not work, try using & or § or changing the order of the two,
This is the block placement required in order to define a cannons and its interaction. You can create the schematic using WorldEdit or using the new schematic format (3.5.0+ only), which also supports custom blocks, a schematic will end with either:
- .vschem (3.5.0+)
- .schem
- .schematic
It is not as simple as just taking your cannon build and making the schematic, as some block types will define the actual behaviour of the cannon, the block types and their behaviour is defined in the Design Definition.
Note
We don't support block data detection, this is a bug that isn't getting fixed mainly for backwards compatibility and to not break existing cannon servers.
The best way to learn to make a schematic is to see how one of them was made, I am using classic as a reference, this is the original schematic which then Cannons interprets:
As you can see it is not the same as the actual build that you would get from running /cannons create classic, there are some blocks that are different as you can see. In order to figure out what is going on, we need to open up the design definition of classic but first let's go back to a small section of the design definition for a second.
constructionBlocks:
#blocks of the cannon schematic which are ignored and not required to build the cannon. Default is sand
ignore: 'minecraft:sand'
#the block which the projectile is fired from the cannon, direction can be adjusted using the defaultHorizontalFacing property. Default is block of snow
muzzle: 'minecraft:snow_block'
#the block used to indicate when a cannon has been fired. default is torch. Makes fancy smoke on this location
firingIndicator: 'minecraft:torch'
#the block used to indicate where the player can place chests or signs on the cannon. Default is a blank wall sign
chestAndSign: 'minecraft:oak_wall_sign'
#indicates where redstone torches can be placed for redstone autoload and firing to work. Default is redstone torch
redstoneTorch: 'minecraft:redstone_torch'
#the block used to indicate where redstone wiring needs to be placed for redstone autoloading and firing to work. Default is redstone repeater
restoneWireAndRepeater: 'minecraft:repeater'
#options for where a redstone signal needs to lead to in order to activate redstone autoloading and firing
redstoneTrigger:
#the block used by the schematic to indicate where the redstone signal needs to lead to. Default is a lever
schematic: 'minecraft:lever[face=wall,facing=east]'
#the block used in game where the redstone signal needs to lead to. Default is stone button
ingame: 'minecraft:stone_button[face=wall,facing=east]'
#the blocks which a player right clicks in order to fire a cannon
rightClickTrigger:
#the block used in the cannons schematic which is used to fire the cannon when right clicked by a player. Default is torch
schematic: 'minecraft:torch'
#the block used in game to fire the cannon when right clicked by a player. Default is torch
ingame: 'minecraft:torch'
#list of blocks in the schematic that will be protected from explosions (e.g. buttons, because they break easily)
protectedBlocks:
- 'minecraft:torch'
- 'minecraft:lever'
- 'minecraft:stone_button'Warning
Replacing any of these will require you to remake the schematic most of the time, so think about these before making the schematic
Caution
Don't specify some block types to have the same behaviour, like having both muzzle and firing indicator as minecraft:snow_block, this is unsupported behaviour
Here let's have a slightly more detailed explaination:
-
ignore= This block type is invisible to the schematic, use it to help building the schematic, some people replace it to dirt -
muzzle= Required, each cannon has ONLY one muzzle, you can place more but the average location will become the real muzzle, if you want more projectiles to fire, you can use define projectiles inside the/projectilefolder that behave like so -
firingIndicator= Spawns a bunch of moke, you can have as many as you want -
chestAndSign= Marks which chest can be used for auto reload and auto cooling, also used by Cannon-Signs -
redstoneTorch= Redstone torch impulse will trigger autofire/autoreload/autocooling -
restoneWireAndRepeater= Redstone wire/repeater impulse will trigger autofire/autoreload/autocooling -
redstoneTrigger= ANY redstone impulse will trigger autofire/autoreload/autocooling, it can be of one type in the schematic, but the actual block requirement be replace ingame by cannons on load -
rightClickTrigger= Player right click will trigger autofire/autoreload, it can be of one type in the schematic, but the actual block requirement be replace ingame by cannons on load -
protectedBlocks= These blocks won't be blown away when exploded or when you try to mine them
Most people struggle here, so don't worry if everything isn't perfect at first try. Once you defined everything, built the required structure, it is time to give life to your now beautiful cannon.
Create the schematic with WorldEdit (using //schematic ... command) or using our own schematic format (essential for custom blocks with /cannons schematic ...) and a file will be generated, move said file in the /design/ folder in the plugin configuration, the name of the schematic and file definition must be the EXACT same. Run /cannons reload, check for errors, do some testing and you are ready to go!