Item must have specific name and Id in villager trades

Discussion in 'Archived: Plugin Requests' started by LordDarthBob, Jun 19, 2014.

  1. Offline

    LordDarthBob

    Plugin category: Mechanics

    Suggested name: Picky Villagers

    What I want: Normally, when trading with a villager, even if an item that is placed by a player into the trading GUI has a different name or damage value (i.e stone:#) than the item required for trading, if the item is the same item type the trade will still work.

    What this plugin would do is only allow trades where the item offered by the player has the same name, damage value and item type as the item required, not only the item type.

    Ideas for commands: No commands needed for this plugin.

    Ideas for permissions: No permissions needed for this plugin.

    When I'd like it by: Sometime this week if possible.
     
  2. Offline

    LordDarthBob

  3. Offline

    LordDarthBob

  4. Offline

    LordDarthBob

  5. Offline

    LordDarthBob

  6. Offline

    LordDarthBob

  7. Offline

    LordDarthBob

  8. Offline

    LordDarthBob

    Bump
     
  9. Offline

    LordDarthBob

    *Bump*
    ~300 views, no comments. :) :) :) :'(
     
  10. Offline

    LordDarthBob

    Still bumping :)
     
  11. Offline

    LordDarthBob

  12. Offline

    bonecrusher238

    I don't think this would be possible through a plugin LordDarthBob
     
  13. Offline

    LordDarthBob

    bonecrusher238
    I believe that it is 100% possible with a plugin. I have seen plugins that are able to check the contents of several slots of an inventory, plugins that are able to compare two items based on name and id and plugins that can set the contents of an inventory slot to air, which are the only required mechanisms for this plugin.

    The only hangup would be if there's no api built into Bukkit for handling villager inventories, but at this point, as villager trading was introduced in Minecraft 1.3, I would find a lack thereof vexing.

    Incredibly detailed plugin explaination because the original was.. meh. (open)

    Because I noticed after glancing at it a bit that my original explanation of the plugin's function was lacking in detail, I will provide a more thorough, organized explanation.

    [​IMG]
    In normal Minecraft, even if item A has a different damage value id (280:3 in this case) or name ("Money Stick" in this case) than item B, the trade will still work, as shown.



    [​IMG]

    With the plugin, if item A has either a different damage id than item B (in the case of the above picture, 280:3 compared to 280:0) or a different name (in the case of the above picture, "Money Stick" compared to no name),
    the plugin would cancel the trade so that no item is output in the result slot, as seen.



    [​IMG]

    However, with the plugin, if item A has the same damage id as item B (in the case above, both are 280:3) and the same name (in the case above, both are named "Money Stick"), the trade will still work, as shown in the above picture.
     
  14. Offline

    Zupsub

    So how do you let the villager trade with a stick called "money stick"? Do you use a plugin for that or do you just want to prevent a users can use "money sticks" where normal sticks are needed?
     
  15. Offline

    bonecrusher238

    This is already possible in game..
     
  16. Offline

    LordDarthBob

    Zupsub
    The "Money stick" was an example; I was only trying to describe how trade mechanics would work before and after the plugin.

    What I was trying to get at was that, when trading with a villager in normal Minecraft, if the villager said it wanted an item from you with a specific meta-id and/or name, you could give the villager an item of the same item type the with a different meta-id or name and the trade still works perfectly fine.

    What the plugin would do is stop the trade from working if the item offered by the player for the trade had a different name or meta-id than what the villager wanted for the trade.

    (By meta-id I mean the :# on an item id, such as item:3 or item:0.)

    bonecrusher238
    Trading does not work this way in vanilla Minecraft; villagers are not picky about item names or meta-id. I would like them to be.
     
  17. Offline

    bonecrusher238

    Ohhh I get it..
     
  18. Offline

    LordDarthBob

    bonecrusher238
    By chance do you have enough Bukkit and Java experience to develop this plugin? If not, I understand. Just thought I'd ask. :)
     
  19. Offline

    sebdomsan54

    Nope sadly this pluing is not possible because the villiger trade system only checks ids not nbt tags
    however it could work with damage values in the id
     
  20. Offline

    LordDarthBob

    sebdomsan54
    Yes, the villager trading system does not check NBT tags. This is why I am asking for a plugin to do that job.
     
  21. Offline

    Jogy34

  22. Offline

    LordDarthBob

    Thanks! :D

    Like I said
    [​IMG]
     

Share This Page