public class SignEvents implements Listener { private final JavaPlugin plugin; public SignEvents(JavaPlugin plugin) { this.plugin = plugin; } @EventHandler public void onPlayerInteract(PlayerInteractEvent e) { if (e.getClickedBlock() == null || !(e.getClickedBlock().getState() instanceof Sign)) { return; } Sign sign = (Sign) e.getClickedBlock().getState(); String text = sign.getSide(Side.FRONT).getLine(0); if (text.equalsIgnoreCase("test")) { BukkitTask task = new BukkitRunnable() { @Override public void run() { Inventory inv = e.getPlayer().getInventory(); final ItemStack testItem = new ItemStack(Material.DIAMOND_BLOCK, 10); inv.clear(); inv.addItem(new ItemStack(Material.DIAMOND_BLOCK, 60)); try { Thread.sleep(1000); } catch (InterruptedException exception) { throw new RuntimeException(exception); } inv.addItem(testItem); try { Thread.sleep(1000); } catch (InterruptedException exception) { throw new RuntimeException(exception); } inv.removeItem(testItem); } }.runTaskTimer(this.plugin, 5 * 20L, 5 * 20L); } } }