GunsAPI
About
This is an API that allows developers to easily create gun plugins. It comes with several methods that you can call to shoot a gun, shoot a RPG, throw a grenade, or shoot a shotgun. There are 4 bullet types that you can choose from.
- Ender pearl
- Snowball
- Egg
- Arrow This plugin does not have any config, Permissions, or commands.
How to use
For server owners: You would only need this plugin if another plugin told you that it is needed. To install:
- Download
- Place in your plugins folder
- Reload or start your server.
- Done
For developers:
Methods
- setExplosionCancel(boolean cancel)
- setEnderPearlTeleportCancel(boolean cancel)
- shootGun(double Damage, Player shooter, Vector volocity, BulletType bulletType, boolean sound)
- shootRPG(double Damage, Player shooter, Vector volocity, BulletType bulletType, double Explosion, boolean sound)
- shootGrenade(double Damage, Player shooter, Vector volocity, BulletType bulletType, double Explosion, boolean sound)
- shootShootgun(double Damage, Player shooter, Vector volocity, BulletType bulletType, int Shells, boolean sound)
Events
- GunHitEvent - This is called when a bullet, grenade, or RPG hits something. (Ground or entity) This event is cancellable. GunHitEvent's methods:
- getGun() - returns Gun
- getVelocity() - returns vector
- getShooter() - returns Player
- getDamage() - returns double
- getBulletType() - returns BulletType
- getExplosion() - returns double
- getBullet() - returns Entity
- isCancelled() - returns if it is canceled
- setCancelled(boolean cancel) - sets if it is canceled
- setGun(Gun gun) - sets Gun
- setVelocity(Vector velocity) - set velocity
- setDamage(double Damage) - set damage
- setBulletType(BulletType bullet) - set BulletType
- setExplosion(double explosion) - set explosion __________
- GunHitEntityEvent - This is called when a bullet, grenade, or RPG hits an entity. This event is cancellable. GunHitEntityEvent's methods:
- getEntity() - returns Entity (The one it hit)
- getGun() - returns Gun
- getVelocity() - returns vector
- getShooter() - returns Player
- getDamage() - returns double
- getBulletType() - returns BulletType
- getExplosion() - returns double
- getBullet() - returns Entity
- isCancelled() - returns if it is canceled
- setCancelled(boolean cancel) - sets if it is canceled
- setGun(Gun gun) - sets Gun
- setVelocity(Vector velocity) - set velocity
- setDamage(double Damage) - set damage
- setBulletType(BulletType bullet) - set BulletType
- setExplosion(double explosion) - set explosion