- Баллы
- 66
UPD: Ошибку нашёл, спасибо кто старался)
Привет, у меня такая проблема.
У меня в плагине есть ивент:
@EventHandler
public void dirtmine(BlockBreakEvent e) {
Player p = e.getPlayer();
Block b = e.getBlock();
if(e.getBlock().getType() != Material.DIRT) return;
{
int x = rfdm.nextInt(1000);
if( x <= 1000) {
e.setCancelled(true);
b.setType(Material.AIR);
ItemStack dirt = new ItemStack(Material.DIAMOND_BLOCK);
ItemMeta meta = dirt.getItemMeta();
dirt.setItemMeta(meta);
b.getWorld().dropItemNaturally(b.getLocation(), dirt);
}
}
}
И он работает!
НО! В консоле появляется ошибка что, не удалось пройти событие(ниже скрин).
Привет, у меня такая проблема.
У меня в плагине есть ивент:
@EventHandler
public void dirtmine(BlockBreakEvent e) {
Player p = e.getPlayer();
Block b = e.getBlock();
if(e.getBlock().getType() != Material.DIRT) return;
{
int x = rfdm.nextInt(1000);
if( x <= 1000) {
e.setCancelled(true);
b.setType(Material.AIR);
ItemStack dirt = new ItemStack(Material.DIAMOND_BLOCK);
ItemMeta meta = dirt.getItemMeta();
dirt.setItemMeta(meta);
b.getWorld().dropItemNaturally(b.getLocation(), dirt);
}
}
}
И он работает!
НО! В консоле появляется ошибка что, не удалось пройти событие(ниже скрин).

Последнее редактирование: