Plugin category: Mechanincs Suggested name: FriendlyVillagers What I want: Enabling Villagers to trade for more than 1 player at the same time Ideas for commands: No commands needed for this plugin. Ideas for permissions: No permissions needed. When I'd like it by: As soon as possible .
I don't know allot about java but there is a slight possibility that it's not possible because minecraft has its own laws and physics and changing the amount of people trading with villagers at once might possibly break minecraft.
Not necessarily, plugins can always make their own custom trade inventories for multiple players, the plugin could check when a player clicks the villager (PlayerInteractEntityEvent) - cancel the open of the regular trade inventory, and then open the custom trade inventory for the player with the usual trade items.
Yeah, its virtual, but you can obviously go look at the original minecraft code for villager trading and and just use the default items as used in vanilla minecraft. See i have just gone and looked at the regular minecraft code in forge for adding the items to the villager and you can easily see what items are added and what for in this method below pulled out of the EntityVillager class. Code:java /** * based on the villagers profession add items, equipment, and recipies adds par1 random items to the list of things * that the villager wants to buy. (at most 1 of each wanted type is added) */ private void addDefaultEquipmentAndRecipies(int par1) { if (this.buyingList != null) { this.field_82191_bN = MathHelper.sqrt_float((float)this.buyingList.size()) * 0.2F; } else { this.field_82191_bN = 0.0F; } MerchantRecipeList var2; var2 = new MerchantRecipeList(); int var6; label50: switch (this.getProfession()) { case 0: func_146091_a(var2, Items.wheat, this.rand, this.adjustProbability(0.9F)); func_146091_a(var2, Item.getItemFromBlock(Blocks.wool), this.rand, this.adjustProbability(0.5F)); func_146091_a(var2, Items.chicken, this.rand, this.adjustProbability(0.5F)); func_146091_a(var2, Items.cooked_fished, this.rand, this.adjustProbability(0.4F)); func_146089_b(var2, Items.bread, this.rand, this.adjustProbability(0.9F)); func_146089_b(var2, Items.melon, this.rand, this.adjustProbability(0.3F)); func_146089_b(var2, Items.apple, this.rand, this.adjustProbability(0.3F)); func_146089_b(var2, Items.cookie, this.rand, this.adjustProbability(0.3F)); func_146089_b(var2, Items.shears, this.rand, this.adjustProbability(0.3F)); func_146089_b(var2, Items.flint_and_steel, this.rand, this.adjustProbability(0.3F)); func_146089_b(var2, Items.cooked_chicken, this.rand, this.adjustProbability(0.3F)); func_146089_b(var2, Items.arrow, this.rand, this.adjustProbability(0.5F)); if (this.rand.nextFloat() < this.adjustProbability(0.5F)) { var2.add(new MerchantRecipe(new ItemStack(Blocks.gravel, 10), new ItemStack(Items.emerald), new ItemStack(Items.flint, 4 + this.rand.nextInt(2), 0))); } break; case 1: func_146091_a(var2, Items.paper, this.rand, this.adjustProbability(0.8F)); func_146091_a(var2, Items.book, this.rand, this.adjustProbability(0.8F)); func_146091_a(var2, Items.written_book, this.rand, this.adjustProbability(0.3F)); func_146089_b(var2, Item.getItemFromBlock(Blocks.bookshelf), this.rand, this.adjustProbability(0.8F)); func_146089_b(var2, Item.getItemFromBlock(Blocks.glass), this.rand, this.adjustProbability(0.2F)); func_146089_b(var2, Items.compass, this.rand, this.adjustProbability(0.2F)); func_146089_b(var2, Items.clock, this.rand, this.adjustProbability(0.2F)); if (this.rand.nextFloat() < this.adjustProbability(0.07F)) { Enchantment var8 = Enchantment.enchantmentsBookList[this.rand.nextInt(Enchantment.enchantmentsBookList.length)]; int var10 = MathHelper.getRandomIntegerInRange(this.rand, var8.getMinLevel(), var8.getMaxLevel()); ItemStack var11 = Items.enchanted_book.getEnchantedItemStack(new EnchantmentData(var8, var10)); var6 = 2 + this.rand.nextInt(5 + var10 * 10) + 3 * var10; var2.add(new MerchantRecipe(new ItemStack(Items.book), new ItemStack(Items.emerald, var6), var11)); } break; case 2: func_146089_b(var2, Items.ender_eye, this.rand, this.adjustProbability(0.3F)); func_146089_b(var2, Items.experience_bottle, this.rand, this.adjustProbability(0.2F)); func_146089_b(var2, Items.redstone, this.rand, this.adjustProbability(0.4F)); func_146089_b(var2, Item.getItemFromBlock(Blocks.glowstone), this.rand, this.adjustProbability(0.3F)); Item[] var3 = new Item[] {Items.iron_sword, Items.diamond_sword, Items.iron_chestplate, Items.diamond_chestplate, Items.iron_axe, Items.diamond_axe, Items.iron_pickaxe, Items.diamond_pickaxe}; Item[] var4 = var3; int var5 = var3.length; var6 = 0; while (true) { if (var6 >= var5) { break label50; } Item var7 = var4[var6]; if (this.rand.nextFloat() < this.adjustProbability(0.05F)) { var2.add(new MerchantRecipe(new ItemStack(var7, 1, 0), new ItemStack(Items.emerald, 2 + this.rand.nextInt(3), 0), EnchantmentHelper.addRandomEnchantment(this.rand, new ItemStack(var7, 1, 0), 5 + this.rand.nextInt(15)))); } ++var6; } case 3: func_146091_a(var2, Items.coal, this.rand, this.adjustProbability(0.7F)); func_146091_a(var2, Items.iron_ingot, this.rand, this.adjustProbability(0.5F)); func_146091_a(var2, Items.gold_ingot, this.rand, this.adjustProbability(0.5F)); func_146091_a(var2, Items.diamond, this.rand, this.adjustProbability(0.5F)); func_146089_b(var2, Items.iron_sword, this.rand, this.adjustProbability(0.5F)); func_146089_b(var2, Items.diamond_sword, this.rand, this.adjustProbability(0.5F)); func_146089_b(var2, Items.iron_axe, this.rand, this.adjustProbability(0.3F)); func_146089_b(var2, Items.diamond_axe, this.rand, this.adjustProbability(0.3F)); func_146089_b(var2, Items.iron_pickaxe, this.rand, this.adjustProbability(0.5F)); func_146089_b(var2, Items.diamond_pickaxe, this.rand, this.adjustProbability(0.5F)); func_146089_b(var2, Items.iron_shovel, this.rand, this.adjustProbability(0.2F)); func_146089_b(var2, Items.diamond_shovel, this.rand, this.adjustProbability(0.2F)); func_146089_b(var2, Items.iron_hoe, this.rand, this.adjustProbability(0.2F)); func_146089_b(var2, Items.diamond_hoe, this.rand, this.adjustProbability(0.2F)); func_146089_b(var2, Items.iron_boots, this.rand, this.adjustProbability(0.2F)); func_146089_b(var2, Items.diamond_boots, this.rand, this.adjustProbability(0.2F)); func_146089_b(var2, Items.iron_helmet, this.rand, this.adjustProbability(0.2F)); func_146089_b(var2, Items.diamond_helmet, this.rand, this.adjustProbability(0.2F)); func_146089_b(var2, Items.iron_chestplate, this.rand, this.adjustProbability(0.2F)); func_146089_b(var2, Items.diamond_chestplate, this.rand, this.adjustProbability(0.2F)); func_146089_b(var2, Items.iron_leggings, this.rand, this.adjustProbability(0.2F)); func_146089_b(var2, Items.diamond_leggings, this.rand, this.adjustProbability(0.2F)); func_146089_b(var2, Items.chainmail_boots, this.rand, this.adjustProbability(0.1F)); func_146089_b(var2, Items.chainmail_helmet, this.rand, this.adjustProbability(0.1F)); func_146089_b(var2, Items.chainmail_chestplate, this.rand, this.adjustProbability(0.1F)); func_146089_b(var2, Items.chainmail_leggings, this.rand, this.adjustProbability(0.1F)); break; case 4: func_146091_a(var2, Items.coal, this.rand, this.adjustProbability(0.7F)); func_146091_a(var2, Items.porkchop, this.rand, this.adjustProbability(0.5F)); func_146091_a(var2, Items.beef, this.rand, this.adjustProbability(0.5F)); func_146089_b(var2, Items.saddle, this.rand, this.adjustProbability(0.1F)); func_146089_b(var2, Items.leather_chestplate, this.rand, this.adjustProbability(0.3F)); func_146089_b(var2, Items.leather_boots, this.rand, this.adjustProbability(0.3F)); func_146089_b(var2, Items.leather_helmet, this.rand, this.adjustProbability(0.3F)); func_146089_b(var2, Items.leather_leggings, this.rand, this.adjustProbability(0.3F)); func_146089_b(var2, Items.cooked_porkchop, this.rand, this.adjustProbability(0.3F)); func_146089_b(var2, Items.cooked_beef, this.rand, this.adjustProbability(0.3F)); } if (var2.isEmpty()) { func_146091_a(var2, Items.gold_ingot, this.rand, 1.0F); } Collections.shuffle(var2); if (this.buyingList == null) { this.buyingList = new MerchantRecipeList(); } for (int var9 = 0; var9 < par1 && var9 < var2.size(); ++var9) { this.buyingList.addToListWithCheck((MerchantRecipe)var2.get(var9)); } }