summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/yulqen/test/GiveMeDiamond.java
diff options
context:
space:
mode:
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;
+ }
+}