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.
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
Well, it has to be a custom recipe in a brewing stand, not a crafting table. I am using custom potions
@RBHB16 i know, but it's kinda weird minecraft seems to control the ingredient's you put into there before something happens edit: maybe you can find something in here https://bukkit.org/threads/help-with-creating-custom-brewing-ingredients.302364/
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.
@RBHB16 ((BrewingStand) brewingStand).setBrewingTime((int) brewTimer); in a task after a few checks is how McMMO updates the arrow. https://github.com/mcMMO-Dev/mcMMO/...nossr50/runnables/skills/AlchemyBrewTask.java
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?
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.