What it does: StraightToInv is a unique plugin for prison servers. It is a plugin which makes drops from mines go straight to the player's inventory! How cool is that? The purpose of this plugin is so that player's don't steal other players blocks! It also works great for Factions, or something similar. For example: Player holds axe, breaks wood with axe, wood doesn't drop, instead it goes straight to the players inventory! Why we need this: The community really needs this because players are sick of other players stealing their stuff that they earned by for example: killing a player with op armor, finding diamonds, etc. so please find a solution to this! Permissions: sti.use Config: disabled-worlds: - Disabledworld1 - Disabledworld2 Worldguard, Factions, and PlotMe: Please make sure that players won't be able to override Worldguard, Factions, and PlotMe. What I mean is don't let them be able to break Worldguard, Factions, or PlotMe regions like similar plugins to this one do. *UPDATE: The plugin will be uploaded to the public on this page on the 11th-14th!
I can do this, pretty simple. I will post when I finish it in here. It's done, check the [x] in my signature EDIT by Moderator: merged posts, please use the edit button instead of double posting.
EnderTroll68 But you don't cancel the event. Won't the blocks get dropped to the ground and the inventory?
Whoops. You are right. My bad. Fixing it now. Edit: You could have just asked for the source rather than decompiling it. Well I uploaded a new version, this one will work but it is not affected by fortune. To get that part working I will need a bit longer since I am busy and do not have time to code it at the moment EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Hi, looks like I came across a problem I got an error because you compiled the plugin with Java 8, and I am running Java 7. If you could change it to Java 7 that would be great! Here's the log: http://pastebin.com/NABdmHET Ok, so I've installed Java 8 and it's working fine now. The blocks aren't dropping which is what I expected.. BUT I am not getting anything in my inventory EDIT by Moderator: merged posts, please use the edit button instead of double posting.
timtower I don't have java 7 though Like I said, I don't have time to make sure this works, it was supposed to only take me like 10 minutes. If someone else wants to pick it up, here is the source: Code:java public class Main extends JavaPlugin implements Listener { public void onEnable() { saveDefaultConfig(); Bukkit.getPluginManager().registerEvents(this, this); } @EventHandler(priority = EventPriority.HIGHEST) public void onBlockBreak(BlockBreakEvent e) { if (!e.getPlayer().hasPermission("sti.use")) { return; } if (e.getPlayer().getGameMode() != GameMode.SURVIVAL) return; if (e.isCancelled()) { return; } for (String string : getConfig().getStringList("disabled-worlds")) { if (e.getPlayer().getLocation().getWorld().getName().equalsIgnoreCase(string)) { return; } } if (e.getPlayer().getItemInHand().getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) > 0) { for (ItemStack is : e.getBlock().getDrops(e.getPlayer().getItemInHand())) { e.getPlayer().getInventory().addItem(is); } } else { } e.getBlock().setType(Material.AIR); e.setCancelled(true); }} EDIT by Moderator: merged posts, please use the edit button instead of double posting.
*QUICK UPDATE* The plugin is finished! However I would like a feature that allows fortune to be used. Whoever can implement this please let me know <removed> [edit by JaguarJo: removed personal info. Please keep all discussion on the forums. Thanks.]
Hyperven0m First of all, keep all conversation on the forums. Second, did you even search up at all to find if any plugin does this already? Plugins: http://dev.bukkit.org/bukkit-plugins/drops-to-inventory/ http://dev.bukkit.org/bukkit-plugins/safemining/ Because no one posted the same request, right? https://forums.bukkit.org/threads/drops-to-inventory-plugin-request.272085/ https://forums.bukkit.org/threads/plugin-request-blocks-and-items-to-inventory.276531/ https://forums.bukkit.org/threads/chopped-mined-etc-items-go-straight-to-inventory.18580/ https://forums.bukkit.org/threads/items-directly-to-inventory.274163/ http://forums.bukkit.org/threads/a-few-plugins.307400/#post-2773946https://forums.bukkit.org/threads/drop-to-inventory-or-drop-to-player.284221/ https://forums.bukkit.org/threads/blocks-to-inventory-and-drop-multiplier.237715/ https://forums.bukkit.org/threads/req-blocks-goes-to-inventory.269710/ http://lmgtfy.com/?q=Bukkit Items straight to Inventory