dustinjamesyoder-dev

Create a AK47 with two modes; sniper (one shot), and machine gun. You can also aim, or have it to the side. It has 10 attack damage.

Kodari AI
KodariJun 28 at 6:58 pm 1
AK47Plugin
A Minecraft plugin that adds a functional AK-47 weapon with two firing modes: Sniper (single precise shot with 30-tick cooldown) and Machine Gun (rapid fire with 4-tick cooldown). Features aim-down-sights (ADS) mechanic with movement penalty, hip-fire spread, muzzle flash particles, and custom gunshot sounds. Each shot deals 10 attack damage. Mode switching via sneak+right-click, aim toggle via right-click, and firing via left-click.

Creating 6 files for the AK-47 plugin.

dustinjamesyoder-dev

Make into downloadable mod for mobile Minecraft

Kodari AI
KodariJun 28 at 7:14 pm 1

The plugin I built is for Java Edition servers (runs on a PC server, not on a mobile device). Mobile Minecraft runs Bedrock Edition — completely different codebase. No Java plugins work there.

Your real options:

Option 1 — Bedrock Behavior Pack (most correct for mobile)

  • Uses JSON + JavaScript (GameTest Framework)

  • No Java, no server required — installs like any other mobile add-on

  • Limited compared to a plugin — can’t fully replicate custom gun mechanics

Option 2 — PojavLauncher (Java Edition on mobile)

  • Runs actual Java Edition on Android/iOS

  • The plugin I made would work here if you host a server or play LAN

  • Heavy, not “native mobile”

Option 3 — Use a mobile-friendly gun plugin with an existing Bedrock gun add-on

  • Install a gun behavior pack from MCPEDL + connect to your plugin server


Which path do you want? If Option 1 (Bedrock behavior pack), I can build it — but the mechanics will be simpler (no real ADS, no dual fire modes with cooldowns) because Bedrock’s scripting API has hard limits. I’ll need to use a custom entity shooting snowballs/arrows with damage overrides and component-based items.

If you just want the PojavLauncher + server route, the plugin I already created is complete — you’d run it on a Paper/Spigot server and connect from PojavLauncher.

dustinjamesyoder-dev

Change to bedrock

Kodari AI
KodariJun 28 at 7:19 pm 2

I’ll build a Bedrock Behavior Pack for the AK-47. Let me set up the project structure

I’ll build a Bedrock behavior pack + resource pack for the AK-47. Since I can’t create PNG/ogg binaries through text, I’ll note where you need to add those.

Creating the full addon

AK-47 Bedrock Addon

I’ll build a complete Behavior Pack + Resource Pack for Bedrock Edition. The addon won’t run through text alone — you’ll need to add PNG textures and OGG sounds — but every code file will be complete.

Design (mobile-friendly)

Control
Action
Tap use button
FIRE (sniper: 1 shot, machine gun: automatic)
Sneak + tap use
Switch mode
Sniper mode
Single shot, 30-tick cooldown, accurate, slow movement
Machine Gun mode
Auto-fire, 3-tick cooldown, bullet spread

10 damage per bullet. Uses minecraft:food so right-click fires on mobile.

Creating all files now

Now I have the full picture. Creating 10 files for the complete Bedrock addon.


📁 AK47_BP/manifest.json


📁 AK47_RP/manifest.json


📁 AK47_BP/items/ak47.json


📁 AK47_BP/scripts/main.js


📁 AK47_RP/textures/item_texture.json


📁 AK47_RP/sounds.json


📁 AK47_RP/texts/en_US.lang


📦 How to install on your phone

What you get (files above):

File
Purpose
AK47_BP/
All game logic (firing, modes, damage)
AK47_RP/
Textures + sounds + item names

You need to ADD manually (binary files I can’t generate):

  1. AK47_RP/textures/items/ak47.png — 16×16 or 32×32 PNG of the gun

  2. AK47_RP/sounds/ak47_fire.ogg — machine gun shot (OGG audio)

  3. AK47_RP/sounds/ak47_sniper.ogg — sniper shot (OGG audio)

  4. AK47_RP/sounds/ak47_switch.ogg — mode switch click (OGG audio)

For sounds, grab free .ogg files from freesound.org — or use any audio converter, rename them to match above, and drop them in.

Install steps (mobile):

Step
What to do
1
On your phone, create
AK47_BP/
and
AK47_RP/
folders using a file manager
2
Copy the JSON/JS files above into matching folders
3
Drop your PNG texture into
AK47_RP/textures/items/ak47.png
4
Drop your OGG sounds into
AK47_RP/sounds/
5
Rename
AK47_BP
folder →
AK47_BP.mcaddon
or
AK47_BP.mcpack
6
Rename
AK47_RP
folder →
AK47_RP.mcpack
7
Tap each file on your phone → Minecraft opens and imports them
8
In Minecraft:
Settings → Resource Packs
→ activate
AK-47 Resource Pack
9
In Minecraft:
Settings → Behavior Packs
→ activate
AK-47 Behavior Pack
on your world
10
/give @s ak47:ak47
— you now have the AK-47

Controls (mobile):

Action
How
Fire
Tap the
use button
(right side of screen)
Switch mode
Tap
sneak button
+ tap
use button
at the same time
Sniper mode
1 shot, 1.5s cooldown, very accurate, slow movement
Machine Gun
Rapid auto-fire, 0.15s cooldown, bullet spread, normal movement

Note on sounds: The script currently uses built-in Minecraft sounds (mob.wither.shoot / mob.blaze.shoot). To use your custom .ogg files from AK47_RP/sounds/, update scripts/main.js line ~74-75:

JavaScript
const sound = mode === "sniper" ? "ak47.sniper" : "ak47.fire";

That will switch from built-in sounds to your custom OGG files.

Want me to make any adjustments — different damage, cooldown tweaks, bigger magazine, different projectile visuals?

dustinjamesyoder-dev

What is damage now?

Kodari AI
KodariJun 28 at 7:23 pm 1

10 damage — line 23 of scripts/main.js:

JavaScript
const DAMAGE = 10;

That’s 5 hearts per bullet (Bedrock: 1 damage = ½ heart). Since you can spam fire in machine gun mode (every 3 ticks = 0.15s), you’d kill an unarmored player in 2 shots (2 × 5 hearts = death).

Want me to change it?

dustinjamesyoder-dev

Good

Kodari AI
KodariJun 28 at 7:24 pm 1

👍 The AK-47 is ready. Get your PNG texture and OGG sounds in the resource pack folders, zip it up as .mcaddon, and you’re shooting on your phone.

Kodari can make mistakes. Review important code before using.
Files
AK47_BP
AK47_RP
src
build.gradle
Code
14 693
src/main/java/com/kodari/ak47/AK47Plugin.java
package com.kodari.ak47;

import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;

public class AK47Plugin extends JavaPlugin {

    private static AK47Plugin instance;

    @Override
    public void onEnable() {
        instance = this;
        saveDefaultConfig();
        getServer().getPluginManager().registerEvents(new AK47Listener(this), this);
        getCommand("ak47").setExecutor(this);
        getLogger().info("AK-47 Plugin enabled. Ready to lock and load.");
    }

    @Override
    public void onDisable() {
        getLogger().info("AK-47 Plugin disabled.");
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (!(sender instanceof Player)) {
            sender.sendMessage(ChatColor.RED + "Only players can use this command.");
            return true;
        }
        Player player = (Player) sender;

        if (args.length > 0 && args[0].equalsIgnoreCase("reload")) {
            reloadConfig();
            player.sendMessage(ChatColor.GREEN + "AK-47 config reloaded.");
            return true;
        }

        ItemStack ak47 = AK47Item.create();
        if (ak47 == null) {
            player.sendMessage(ChatColor.RED + "Failed to create AK-47. Check server logs.");
            return true;
        }
        player.getInventory().addItem(ak47);
        player.sendMessage(ChatColor.GRAY + "[" + ChatColor.RED + "AK-47" + ChatColor.GRAY + "] " +
                ChatColor.GREEN + "You received an AK-47. Left-click to fire, right-click to aim.");
        return true;
    }

    public static AK47Plugin getInstance() {
        return instance;
    }
}