Maby someting like this: Location loc = //BlockLocation// World blockworld = //BlockLocation//.getWorld(); Bukkit.getServer.getWorld(BlockWorld).dropItem(m); Replace blocklocation whit the location o the block. Replace all the wrong spelled words whit good spelled words.
Maybe something like this: Location loc = //BlockLocation// World blockworld = //BlockLocation//.getWorld(); Bukkit.getServer.getWorld(BlockWorld).dropItem(m); Replace blocklocation with the location of the block. Replace all the wrong spelled words with properly spelled words.
TheMcScavenger Thank you, My English is not so good and i make the same mistakes all the time. (Like maybe maby, with whit) ('someting' and o was just a mistake typing on my tablet) Maybe is has to do something whit my dyslexie or the size of the tablet.
this is not about correct language. ^^ its about a problem and if i can understand him its fine, but i prefer to put it al in one line^^: Bukkit.getWorld(c.getBlock().getWorld().getName()).dropItem(c.getBlock().getLocation(), new ItemStack(m,1)); ok it works, but i want that it stays at the location where it was dropped. you no an advice? TheLegendOffPabu EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Code:java @EventHandlerpublic void dropItemOnBlockBreak(BlockBreakEvent e){Location blockLocation = e.getblock().getLocation(); e.getBlock().getWorld().dropItemNaturally(blockLocation, new ItemStack(Material.DIAMOND));}
parat26 the item is not exact in the middle of the block. i want that it is on the block, exact in the middle
Maybe you can set the pickup delay at the material? Just make a itemstack and drop that item stack. And i think it is .setPickupDelay(//delay//); Or you have to make a ItemPickupevent or playerpickupevent, And you check o the location is the same as the block.
TheLegendOffPabu what would a delay be usefull for? is there an event witch is used when the plugin 'drops' an item?
No there is no event for that, maybe i did read it wrong but i did think that you want the item to stay on the block? If you set te pickupdelay so high that it cant be picked op? And do you use .dropItem or .dropItemNaturally ? If it wont stay on the right position maybe you can do something with the spawnEntity() ? I will look at my eclipse