Cannons
What can it do?
Cannons is a highly configurable plugin which allows you to fire block build cannons. It is possible to aim and load different amounts of gunpowder to hit targets at different ranges. The power of redstone makes it possible to set the gun to auto load and activate the rapid fire mode. Choose your projectile from a broad spectrum of cannonballs and smash the enemy.
With Cannons 2.0 you are also able to design your own cannons using .schematic files and give each cannon their own settings, as well as different types of projectiles.

Features
- Build a cannon out blocks
- Design your own cannon and save it as .schematic
- Design and fire different projectiles to smash your enemy
- Use redstone to fire guns from distance
- Rapid fire with auto-load possible
- Destroyed blocks can be restored with CreeperHeal (if 'custom' option is true)
- Cannons will stay load and aligned due to the database
- Movement plugins (e.g. Movecraft) are supported if a cannon has a sign to store a tag
- API for ships plugins (e.g. iSails) to use cannons on ships without signs.
Videos
by ServerMiner
by wickedbrother
Out-dated showcase 1
Out-dated showcase 2
Recommended plugins
- ObsidianDestroyer
- WorldGuard (flag protection: '/region flag NAME other-explosion deny')
- CreeperHeal (set 'custom explosion' for your world to repair cannon damage)
Installation
- Install WorldEdit first (don't forget this)
- Copy the cannons.jar into your Bukkit's "plugins" directory, then run the server.
Dependencies
This plugin requires:
Metrics
This plugin utilises Hidendra's plugin metrics system, which means that the following information is collected and sent to mcstats.org:
- A unique identifier
- The server's version of Java
- Whether the server is in offline or online mode
- The plugin's version
- The server's version
- The OS version/name and architecture
- The core count for the CPU
- The number of players online
- The Metrics version If you wish to disable this feature (/me cries), you can do so by opt-ing out, which you can do in the config file under /plugins/PluginMetrics/
Information for Cannons 2.x
Tutorial:
Additional information:
Cannon Designs
- Share your designs with other people: Cannon Designs
Known Bugs
- The cannon ball (snowball) becomes invisible after 60 blocks but hits the target.
- Voxelsniper will delete Buttons/Torches when you load the gun (be careful when you click the barrel)
Need Help?
Credits
- Raser4000
- DreTax
- JlJlJl
- and many more

-
View User Profile
-
Send Message
Posted Jun 26, 2015the thing is, i'm not a coder myself, and if i can understand basic code structure, i got no idea how to use what you gave me there XD
-
View User Profile
-
Send Message
Posted Jun 24, 2015@carmeops Spigot has a new event BlockExplodeEvent which is not supported by many protection plugins. You have to relay the new event to the old one.
-
View User Profile
-
Send Message
Posted Jun 23, 2015i'm on 1.8.7 and despite the region flags for tnt, creeper explosion, other-explosion, ghast-fireball all set to deny, cannons still can damage blocks
-
View User Profile
-
Send Message
Posted Jun 23, 2015@Arjuncraft2001 The code is correct - I just checked it. However you need to import Bukkit 1.8.3. If you use maven you need the new spigot repository:
https://www.spigotmc.org/wiki/spigot-maven/
-
View User Profile
-
Send Message
Posted Jun 22, 2015Thanks for the quick response! So I noticed it had a bunch of errors and I fixed a typo in this first line. Here is a new error on Eclipse that I got with the new code:
public BlockExplodeEvent(BlockExplodeEvent event) {
BlockExplodeEvent.BlockExplodeEvent cannot be resolved to a type
It might have been a result of taking out void, but void was apparently invalid.
-
View User Profile
-
Send Message
Posted Jun 22, 2015@Arjuncraft2001 If you use spigot 1.8.3 you will have a problem with the new BlockExplosedEvent. This event replaces the old EntityExplodeEvent if the enitity is null - which is the case for world.createExplosion() used by Cannons. Therefore no protection plugin will work if you don't have the version for 1.8.3.
You can relay the new event to the old one, to make old protection plugins working.
Autoaiming is working, but I am not completely happy with the way to use it. But it is 80% finished.
-
View User Profile
-
Send Message
Posted Jun 21, 2015Dear DerParlov,
Let me start this by saying that your work is very advanced, truly professional stuff you've done here. I'm the creator of a new, small Movecraft Server called Castle Siege MC.
Believe me, I have tried CreeperHeal, ExplosionRegen, and Aplosions. None of them work with your plugin.
So I went to work on my own plugin. I have done hours of research on the Github of CreeperHeal and Cannons, and have asked a lot of experienced developers some questions (including the developer of Towny, who I just so happened to pass by in Server Chat).
The Towny Dev gave me a lot of help, but I'll be honest here, I am new to Java and have only developed three plugins, all of which are just basic, like a kill tracker plugin, anti-enchantment plugin, etc, and the bottom line is that even with all the research I have done on your plugin and regen plugins, I still have very little idea of what I'm doing.
From looking at Github, I have cause to believe that your plugin makes a truly custom explosion, breaking the blocks and making the effects. I know that it calls an event, and that it keeps a list of blocks in LinkedList<Block>() method.
Could you either help me make new plugin for this or make a configurable setting in the Cannons plugin for regenerating blocks? I've literally spent hours and hours trying to fix this problem, its been persisting for months. I know this sounds a little selfish, but I am sure there are others who also would like regen on their cannons :D. If you would consider this request I would be overjoyed!
-
View User Profile
-
Send Message
Posted Jun 21, 2015Any info on when the auto-aiming will be implemented, where the cannons automatically target mobs? I think I remember you mentioning you were going to add some feature like that in the future
-
View User Profile
-
Send Message
Posted Jun 20, 2015@Ethon6Are using a mySQL database? I will run some test to verify the problem.
-
View User Profile
-
Send Message
Posted Jun 19, 2015I get a console warn: plz fix it:
19.06 08:54:32 [Server] INFO ... 8 more 19.06 08:54:32 [Server] INFO at com.avaje.ebeaninternal.server.transaction.TransactionManager.createTransaction(TransactionManager.java:316) 19.06 08:54:32 [Server] INFO at com.avaje.ebeaninternal.server.lib.sql.DataSourcePool.getConnection(DataSourcePool.java:641) 19.06 08:54:32 [Server] INFO at com.avaje.ebeaninternal.server.lib.sql.DataSourcePool.getPooledConnection(DataSourcePool.java:653) 19.06 08:54:32 [Server] INFO at com.avaje.ebeaninternal.server.lib.sql.PooledConnectionQueue.getPooledConnection(PooledConnectionQueue.java:247) 19.06 08:54:32 [Server] INFO at com.avaje.ebeaninternal.server.lib.sql.PooledConnectionQueue._getPooledConnection(PooledConnectionQueue.java:307) 19.06 08:54:32 [Server] INFO at com.avaje.ebeaninternal.server.lib.sql.PooledConnectionQueue._getPooledConnectionWaitLoop(PooledConnectionQueue.java:333) 19.06 08:54:32 [Server] INFO Caused by: java.sql.SQLException: Unsuccessfully waited [1000] millis for a connection to be returned. No connections are free. You need to Increase the max connections of [20] or look for a connection pool leak using datasource.xxx.capturestacktrace=true 19.06 08:54:32 [Server] INFO ... 3 more 19.06 08:54:32 [Server] INFO at org.bukkit.craftbukkit.v1_8_R2.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:53) 19.06 08:54:32 [Server] INFO at org.bukkit.craftbukkit.v1_8_R2.scheduler.CraftTask.run(CraftTask.java:53) 19.06 08:54:32 [Server] INFO at at.pavlov.cannons.dao.PersistenceDatabase$2.run(PersistenceDatabase.java:149) 19.06 08:54:32 [Server] INFO at at.pavlov.cannons.dao.PersistenceDatabase.saveAllCannons(PersistenceDatabase.java:164) 19.06 08:54:32 [Server] INFO at com.avaje.ebeaninternal.server.core.DefaultServer.beginTransaction(DefaultServer.java:857) 19.06 08:54:32 [Server] INFO at com.avaje.ebeaninternal.server.transaction.TransactionManager.createTransaction(TransactionManager.java:350) 19.06 08:54:32 [Server] INFO Caused by: javax.persistence.PersistenceException: java.sql.SQLException: Unsuccessfully waited [1000] millis for a connection to be returned. No connections are free. You need to Increase the max connections of [20] or look for a connection pool leak using datasource.xxx.capturestacktrace=true 19.06 08:54:32 [Server] INFO at java.lang.Thread.run(Thread.java:745) 19.06 08:54:32 [Server] INFO at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 19.06 08:54:32 [Server] INFO at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 19.06 08:54:32 [Server] INFO at org.bukkit.craftbukkit.v1_8_R2.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:56) 19.06 08:54:32 [Server] WARN org.apache.commons.lang.UnhandledException: Plugin Cannons v2.2.6 generated an exception while executing task 1100497 19.06 08:54:32 [Server] WARN Exception in thread "pool-3-thread-1390"
-
View User Profile
-
Send Message
Posted Jun 4, 2015@Dutch_Boy No problem, actually it is a little bit confusing :)
-
View User Profile
-
Send Message
Posted Jun 2, 2015It works! Thanks,
Sorry for not checking Main Config page.
-
View User Profile
-
Send Message
Posted Jun 1, 2015@Dutch_Boy Hi, for mysql the section should look like this:
http://dev.bukkit.org/bukkit-plugins/cannons/pages/main-config-file-de-de/
-
View User Profile
-
Send Message
Posted May 31, 2015http://pastebin.com/gFzviV9k
username: mc_10 password: isolation: MySql driver: mc_10 url: 127.0.0.1
Hi there. Im trying to use the database option, but i think im doing something wrong. Can you pls tell me what im doing wrong :)
Thanks.
-
View User Profile
-
Send Message
Posted May 30, 2015@GodsDead I have to admit, I have never worked with named items, but I do see why it should not work. After a few test will can tell you more.
-
View User Profile
-
Send Message
Posted May 30, 2015This may be a complete ludicrous request, but here it goes. I have a kit for one of my ranks that gives that person gunpowder, I named this gunpowder so they know what it is, the idea is so they can use this gunpowder in cannons, but named items don't work as fuel (gunpowder) in cannons/autoloading, is there a way I can add this named item to the fuel list? I know you can set the type of item, but I would want to use normal gunpowder & Named gunpowder, is this possible? Or should I just remove the name?
-
View User Profile
-
Send Message
Posted May 28, 2015@Loraxe42 It is not a bug, it is a feature of Craftbukkit 1.8.3. Explosion fires now (1.8.3) a BlockExplodeEvent if the entity is null. Which is the case for world.createExplosion. However since no plugin supports BlockExplodeEvent, everything blows up. https://hub.spigotmc.org/jira/browse/SPIGOT-751?jql=text%20~%20%22explosion%22 https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/commits/e387d8dc7752a7f03e6baa1dadaf66ec2e7e3512
For now just call EntityExplodeEvent by yourself with a small plugin as a fix. Maybe there is already something available.
-
View User Profile
-
Send Message
Posted May 27, 2015Hey, have you been able to find a solution to the bug where "other-explosions" / plugin created explosions can no longer be blocked by worldguard / towny / whatever grief prevention plugin? I'm having problems with that for Movecraft and I thought I'd ask to see if you found a solution.
I guess I can just check to see if other-explosion is set to deny, but that would only work with worldguard.
-
View User Profile
-
Send Message
Posted May 21, 2015@cyeag23 Basically a custom cannon consists of a .shematic (which contains the cannon blocks) and a .yml (which has the properties). I think the easiest way to start is copying and renaming the default design. Copy the .schematic to worldedit/schematics and and load it. When you modified your cannon your store the .schematic again and copy it back to cannons/designs.
In the .yml you have to state which block type does what. Briefly a snowblock is the block where the projectile will be spawned and torch is used as a right click trigger. However you can change all block types. Make sure you change both the (.schematic and the .yml). Keep in mind that some block (e.g. buttons, torches) have a facing and have different datavalues. I recommend the plugin 'Whatisit' to get the datavalues of blocks. When your cannon fires in the wrong direction you have to change the 'defaultHorizontalAngle'
http://dev.bukkit.org/bukkit-plugins/cannons/pages/creating-custom-cannons/
-
View User Profile
-
Send Message
Posted May 20, 2015I need on how to make a custom cannon, i keep reading the tutorial and im totally confused how to lol