Question using NMS!

Discussion in 'Plugin Development' started by RBHB16, Jan 29, 2016.

Thread Status:
Not open for further replies.
  1. Offline

    RBHB16

    Hey guys, so I am trying to make a fake potion recipe by using inventory click event to get the ingredient that is being put into the brewing stand, and once it is I'll send packets of like the arrow loading that says it's working, while running a scheduler to remove the ingredient and then replace it with the potions. What I am confused is about, is what packet to look for. I am on the protocol wiki, but it doesn't really tell me what packet it is. Do you guys have any idea? This would also be my first attempt at using reflection with NMS. I've practiced reflection with java without minecraft, so I understand it. But what types of things would I look for in packets to help me do this? All help is greatly appreciated.
     
  2. Offline

    Dmrtje

    You can easily do this without NMS, It's called making custom recipes.
    For example this if for normal crafting recipes:

    Code:
    ShapedRecipe explodeDiamondAxe = new ShapedRecipe(et.DIAMOND_AXE_EXPLODE);
                explodeDiamondAxe.shape("tnt", "ndn", "tnt");
                explodeDiamondAxe.setIngredient('d', Material.DIAMOND_AXE);
                explodeDiamondAxe.setIngredient('t', Material.TNT);
                explodeDiamondAxe.setIngredient('n', Material.NETHER_STAR);
    
    plugin.getServer().addRecipe(explodeDiamondAxe);
    Edit:
    After doing some research for brewing recipes with this method i couldn't find anything so sorry my bad
     
  3. Offline

    RBHB16

    Well, it has to be a custom recipe in a brewing stand, not a crafting table. I am using custom potions
     
  4. Offline

    Dmrtje

  5. Offline

    RBHB16

    What do you mean control before something happens? Also, thanks for the reply. The problem is, I can't really understand the code mcmmo uses, so I can't really help me much. I only understand some of it, like when it is checking to see if it has potion bottles etc.
     
  6. Offline

    Xerox262

    RBHB16 likes this.
  7. Offline

    Dmrtje

    @RBHB16 what i mean is that there isn't a lust op recipes for the brewer
     
    RBHB16 likes this.
  8. Offline

    RBHB16

    Thank you very much, I never decided to check in that file!

    Thanks for your help though, I appreciate it!

    @Dmrtje @Xerox262, this may sound dumb. Why would the coders in AlchemyBrewTask want to get the location of the brewingstand? What purpose does this do with running checks on it and such?
     
    Last edited: Jan 30, 2016
  9. Offline

    Xerox262

    From the looks of it they're using it as a unique identifier for the brewing stand hashmap key. Since there can only be a single block per location, for if they were doing something to all the brewing stands else where, they can access it through the location. They could use the location as a null check, to ensure that someone didn't break the brewing stand between runs but instead they use the block's state.
     
    RBHB16 likes this.
  10. Offline

    RBHB16

    I see, thank you very much!
     
Thread Status:
Not open for further replies.

Share This Page