summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/yulqen/test/GiveMeDiamond.java
diff options
context:
space:
mode:
authorMatthew Lemon <lemon@matthewlemon.com>2020-09-28 21:48:29 +0100
committerMatthew Lemon <lemon@matthewlemon.com>2020-09-28 21:48:29 +0100
commit7678dabfb2d3550d51cf1514807885e6e7b37b20 (patch)
treee01f7bb0b12df0e533fcdd859fb702ede5f31297 /src/main/java/com/yulqen/test/GiveMeDiamond.java
parentbe838b99c1b108049d0027b7ee79dd06f1a5f05a (diff)
joe tires, sophie mines iron, two commands
Diffstat (limited to 'src/main/java/com/yulqen/test/GiveMeDiamond.java')
-rw-r--r--src/main/java/com/yulqen/test/GiveMeDiamond.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/main/java/com/yulqen/test/GiveMeDiamond.java b/src/main/java/com/yulqen/test/GiveMeDiamond.java
new file mode 100644
index 0000000..359a531
--- /dev/null
+++ b/src/main/java/com/yulqen/test/GiveMeDiamond.java
@@ -0,0 +1,22 @@
+package com.yulqen.test;
+
+import org.bukkit.Material;
+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 GiveMeDiamond implements CommandExecutor {
+
+ @Override
+ public boolean onCommand(CommandSender commandSender, Command command, String s, String[] args) {
+ if (commandSender instanceof Player) {
+ Player player = (Player) commandSender;
+ ItemStack diamond = new ItemStack(Material.DIAMOND);
+ diamond.setAmount(64);
+ player.getInventory().addItem(diamond);
+ }
+ return true;
+ }
+}