Plugin category: Fixes/Fun/General Suggested name: RealisticLogBurner What I want: What I want I pretty allready said in the title. I want a plugin that makes logs drop charcoal on an editable percentage when burned. BUT it should really NOT be possible when just chopping the logs with tools. (Like the gold axes or something i saw when i browsed the requests) Ideas for commands: /burnlogpercent XX (chance to drop) /burnlogamount XX (amount of dropped items) Ideas for permissions: player.cangetcc When I'd like it by: Saturday
ThunderWaffeMC here, this should work: Code: MaterialData charcoal = new MaterialData(Material.COAL, (byte)1); // should be charcoal's data, but this is untested. @EventHandler public void onWoodChop(BlockBreakEvent e) { if (e.getBlock().getType() == Material.WOOD && e.getPlayer().getItemInHand() == null && onFire(e.getBlock()) && Math.random() < .33) { // change .33 to whatever's in the config e.setCancelled(true); e.getBlock().setType(Material.AIR); e.getBlock().getWorld().dropItemNaturally(e.getBlock().getLocation(), charcoal.toItemStack(1)); } } private boolean onFire(Block block) { return block.getRelative(BlockFace.UP).getType() == Material.FIRE || block.getRelative(BlockFace.NORTH).getType() == Material.FIRE || block.getRelative(BlockFace.SOUTH).getType() == Material.FIRE || block.getRelative(BlockFace.EAST).getType() == Material.FIRE || block.getRelative(BlockFace.WEST).getType() == Material.FIRE; } Well that was dumb. I completely forgot to make it check if the block is burning or not. Fixed it now. EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Will do. Edit1: Since I have some family things to do. I couldn't do your full request but this of what I have here is just a 33% chance to do what you requested with no config or commands. I will keep working on it when I get back and make a bukkitdev Post https://www.dropbox.com/s/zxk9o5y7tq2mk96/RealisticLogBurner.jar Edit2: Just before I go I have no idea if this works. Im sorry if it doesn't just wait 1-3 hours and I'll be back
im just going to try it //Edit after trying: So now there appears to be a problem. I cant even check if the plugin works because of the fire itself. Right after a log block would drop a piece of charcoal after disappearing, the dirt located right under the block starts to burn for a few seconds and destroys every single drop. Is there a way to make those charcoals non-affected by fire?
Are you sure? Store the UUID into a list, then on the (it may be ItemDespawnEvent, not sure) if(list.contains(event.getEntity().getUniqueId())) although I'm not sure if the event is cancellable Edit: It is cancellable
gomeow Borlea made the plugin, but it still doesnt drop charcoal. If you have the time, it would be nice if you could make it