aber irgendwie geht das nicht wirklich
- Code: Alles auswählen
- if (b == Material.CARROT) {
- e.setCancelled(true);
- Block block = w.getBlockAt(l);
- int i = 0;
- for (ItemStack is : p.getInventory().getContents()) {
- if (is == null) {
- continue;
- }
- if (is.getData().equals(Material.getMaterial(391).getData())) {
- i += is.getAmount();
- p.sendMessage("" + i);
- }
- if (i <= 32) {
- block.setData(CropState.SEEDED.getData());
- block.getWorld().dropItemNaturally(block.getLocation(), new ItemStack(Material.CARROT_ITEM, 2));
- }
- }
- }
bin für jede hilfe dankbar