Hey,
I want to present you my throw axe plugin.
This is just a fun plugin, where you can throw an axe at mobs or players to kill them. You might know this from shooter games like cod.
Apparently, this plugin contains a little config, where you can manage some settings for the axe.
Feel free to download
Features:
- plug and play
- instant kill with axe
- few configurations
I want to present you my throw axe plugin.
This is just a fun plugin, where you can throw an axe at mobs or players to kill them. You might know this from shooter games like cod.
Apparently, this plugin contains a little config, where you can manage some settings for the axe.
Feel free to download
Features:
- plug and play
- instant kill with axe
- few configurations
Spoiler: Config
Code (Text):
axeMaterial: IRON_AXE
axeVector: 1.5
killRadius: 0.6
axeVector: 1.5
killRadius: 0.6
Spoiler: Code
Code (Text):
@EventHandler
public void onInteract(PlayerInteractEvent e) {
if(e.getAction() == Action.RIGHT_CLICK_AIR || e.getAction() == Action.RIGHT_CLICK_BLOCK) {
Player p = e.getPlayer();
try {
if(p.getInventory().getItemInHand().getType() == Material.valueOf(getConfig().getString("axeMaterial"))) {
Item axe = p.getWorld().dropItem(p.getEyeLocation(), p.getItemInHand());
axe.setVelocity(p.getEyeLocation().getDirection().multiply(getConfig().getDouble("axeVector")));
p.getItemInHand().setAmount(0);
new BukkitRunnable() {
@Override
public void run() {
for(Entity ent : axe.getNearbyEntities(getConfig().getDouble("killRadius"), getConfig().getDouble("killRadius"), getConfig().getDouble("killRadius"))) {
if(ent instanceof LivingEntity) {
LivingEntity target = (LivingEntity) ent;
if(ent == p) continue;
target.setHealth(0);
axe.setVelocity(new Vector(0, 0, 0));
cancel();
}
}
if(axe.isOnGround()) {
axe.setVelocity(new Vector(0, 0, 0));
cancel();
}
}
}.runTaskTimer(this, 0, 1);
}
}catch(Exception ex) {
}catch(AssertionError ex) {}
}
}
public void onInteract(PlayerInteractEvent e) {
if(e.getAction() == Action.RIGHT_CLICK_AIR || e.getAction() == Action.RIGHT_CLICK_BLOCK) {
Player p = e.getPlayer();
try {
if(p.getInventory().getItemInHand().getType() == Material.valueOf(getConfig().getString("axeMaterial"))) {
Item axe = p.getWorld().dropItem(p.getEyeLocation(), p.getItemInHand());
axe.setVelocity(p.getEyeLocation().getDirection().multiply(getConfig().getDouble("axeVector")));
p.getItemInHand().setAmount(0);
new BukkitRunnable() {
@Override
public void run() {
for(Entity ent : axe.getNearbyEntities(getConfig().getDouble("killRadius"), getConfig().getDouble("killRadius"), getConfig().getDouble("killRadius"))) {
if(ent instanceof LivingEntity) {
LivingEntity target = (LivingEntity) ent;
if(ent == p) continue;
target.setHealth(0);
axe.setVelocity(new Vector(0, 0, 0));
cancel();
}
}
if(axe.isOnGround()) {
axe.setVelocity(new Vector(0, 0, 0));
cancel();
}
}
}.runTaskTimer(this, 0, 1);
}
}catch(Exception ex) {
}catch(AssertionError ex) {}
}
}
Quick facts
- Edition: Minecraft Java
- File type: .jar
- Minecraft versions listed: 1.8, 1.12
- How to install: Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. → Download the .jar. → Put it in the .minecraft/mods folder and launch that loader profile.
- Where to get it: Opens on Spigot — not every file is mirrored on our own servers.
Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.
Throw Axe is a free Minecraft Java mod. Compatible with Minecraft 1.8, 1.12. Downloaded 144 times (via Spigot). Download it and open it directly in the game.