From b617a39b40993243daaa8371b823acf6c7303f67 Mon Sep 17 00:00:00 2001 From: 0x01fe <0x01fe@0x01fe.net> Date: Mon, 17 Feb 2025 19:51:45 -0600 Subject: [PATCH] adding a list mythic command --- .../hexa/MythicItems/CommandListMythics.java | 24 +++++++++++++++++++ src/main/resources/plugin.yml | 3 +++ 2 files changed, 27 insertions(+) create mode 100644 src/main/java/net/hexa/MythicItems/CommandListMythics.java diff --git a/src/main/java/net/hexa/MythicItems/CommandListMythics.java b/src/main/java/net/hexa/MythicItems/CommandListMythics.java new file mode 100644 index 0000000..319c548 --- /dev/null +++ b/src/main/java/net/hexa/MythicItems/CommandListMythics.java @@ -0,0 +1,24 @@ +package net.hexa.MythicItems; + +import net.hexa.MythicItems.Mythics.MythicItem; +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; + +public class CommandListMythics implements CommandExecutor { + + @Override + public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + if (sender instanceof Player) { + Player player = (Player) sender; + + ItemStack item = MythicItem.getMythicById(0).item; + + player.getInventory().addItem(item); + } + + return true; + } +} diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index b68dd94..355c269 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -7,3 +7,6 @@ commands: essence: description: Gives a Mythic Item Essence usage: / + listMythics: + description: Lists Mythic Items + usage: /