![]() Since I pass a default to getString, I don't really need to enter the type if it's just a normal potion. }You'll notice I didn't put a type for the healing potion. Plugin.getLogger().info("** Invalid potion effect for " + id + "!") tBasePotionData(new PotionData(pt, false, false)) PotionMeta potionMeta = ((PotionMeta) ret.getItemMeta()) ItemStack ret = new ItemStack(pType.equalsIgnoreCase("splash")?Material.SPLASH_POTION:Material.POTION) PotionType pt = PotionType.valueOf(pEffect) Learn how to craft healing potions in Minecraft, a tool that can restore health and buff your character. String pEffect = cfg.getString("effect") ![]() String pType = cfg.getString("type", "normal") You then want to put your base potion of choice in this case, we will use a potion of splash healing to create a potion of. Once you have your needed resource, you need only to go to a brewing station, put in blaze powder to start it up, and then put your bottle of dragon breath in the topmost slot. Obviously one should assume the file could be corrupted and code accordingly, so wrap that in a try/catch to intercept someone fat fingering it and having NIGHT_VSION or something.ĬonfigurationSection cfg = plugin.getConfig().getConfigurationSection("potions." + id) How to Create Lingering Potion in Minecraft. As long as you are writing the PotionType name exactly as the enum has it, you can use PotionEffect.valueOf() to generate a PotionType from the config string. If all you want is potion data, I'd store an entry for what type it is (splash or normal) then another entry for the effect (NIGHT_VISION, INVISIBILITY, etc). Then it captures everything about said item. Personally, I like to just store ItemStacks directly to the config. Like ShaneBee said, we can't really answer what to put in config as it's up to you - you need to decide on your own serialization. If you are making this yourself, then the config is whatever you decide it is. Adding Dragon Breath on splash potion to make lingering potion. Amplifying the potion with glowstone increases this rate to 1 every 1.25 seconds for 0:16 seconds, whereas redstone increases the duration to 1:30 minutes, restores 36 × 18. If you are working with an existing plugin that is just meant for IDs, you're likely out of luck. Splash potion of regeneration heals 1 every 2.5 seconds over 33 seconds, resulting in 13 × 6.5 in total.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |