So I'm trying to expand my knowledge in Java by creating free Spigot plugins, I'm not too good so I won't take on the biggest requests but I'm always open to suggestions! There is a bigger chance I'll do it if I'm allowed to post it on Spigot. ;p
Download, run in 1.11.2, no folder appeared
Can you put the console in a hastebin?Download, run in 1.11.2, no folder appeared[DOUBLEPOST=1493137783][/DOUBLEPOST]nvm dont work in 1.11
![]()
I will PM it you.Can you put the console in a hastebin?
public boolean onCommand(CommandSender sender, Command command, String label, String[] args)
{
if (command.getName().equalsIgnoreCase("opengui")) // Check for the given command.
{
if (sender instanceof Player) // Check if the sender of the command is a player and not the console.
{
Player player = (Player) sender;
Inventory inv = Bukkit.createInventory(null, 9, "§8Trashbin");
ItemStack item = new ItemStack(Material.ANVIL);
ItemMeta meta = item.getItemMeta();
meta.setDisplayName("§7§nClick me");
meta.setLore(Arrays.asList("&fClick here to clear your inventory."));
item.setItemMeta(meta);
inv.setItem(4, item);
player.openInventory(inv);
}
}
return true;
}
@EventHandler
public void onInventoryClick(InventoryClickEvent e)
{
if (e.getInventory().getTitle().equals("§8Trashbin"))
{
if (e.getCurrentItem() != null && e.getCurrentItem().hasItemMeta())
{
if (e.getRawSlot() == 4)
{
e.getWhoClicked().getInventory().clear();
e.getWhoClicked().closeInventory();
e.getWhoClicked().sendMessage("§cCleared inventory for player " + e.getWhoClicked().getName());
}
}
}
}
It was a challenge you know, I was almost done and you spoiled it, thanks. ;-; I tried to do it with just documentation.Just compile this code:
Code:public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { if (command.getName().equalsIgnoreCase("opengui")) // Check for the given command. { if (sender instanceof Player) // Check if the sender of the command is a player and not the console. { Player player = (Player) sender; Inventory inv = Bukkit.createInventory(null, 9, "§8Trashbin"); ItemStack item = new ItemStack(Material.ANVIL); ItemMeta meta = item.getItemMeta(); meta.setDisplayName("§7§nClick me"); meta.setLore(Arrays.asList("&fClick here to clear your inventory.")); item.setItemMeta(meta); inv.setItem(4, item); player.openInventory(inv); } } return true; } @EventHandler public void onInventoryClick(InventoryClickEvent e) { if (e.getInventory().getTitle().equals("§8Trashbin")) { if (e.getCurrentItem() != null && e.getCurrentItem().hasItemMeta()) { if (e.getRawSlot() == 4) { e.getWhoClicked().getInventory().clear(); e.getWhoClicked().closeInventory(); e.getWhoClicked().sendMessage("§cCleared inventory for player " + e.getWhoClicked().getName()); } } } }
I don't know if it's even possible but PM me and I'll try.Could you make a plugin where you do /mail send (name) and it opens a book and quill where it lets you type in your mail. And when you click "Sign" it gives u the option to title the email.
Make a plugin that when you do /cyprus it automatically says "&c%Username% &7has just sent a virtual hug to almighty &6Cyprus.
PM me!Please make a plugin which limits the chests placed & owned. Ex: with permission: chestsplaced.1 = can have at max one chest placed at once. Chestsplaced.2 = a player can have 2 chests placed at once. When you break one you can place another one again.
Basically it makes survival harder with limited chests and it will make you rethink everything twice when it comes to what to store.![]()
Link me it too!! hahaI'll PM you too then, haha.
;p https://www.spigotmc.org/resources/playerrecords.40023/Link me it too!! haha
Well, I know the basics, simple events, chat, config etc.How experienced would you describe yourself with Java? Like what is an example of the difficulty of plugins you can handle? Tell me this and ill recommend some good teaching plugins to develop.
Shoot me a PM! ;pCould you do a simple plugin in which it broadcasts everyone who has top a rank & is online. Also When someone purchases something from the store it gives everyone effects? As in ./speed ./haste etc
