Posted August 24, 201510 yr Trying to follow previous tutorials on Potions and I think I have it working, but I can't figure out how to add my potion to a creative tab. I've got a custom creative tab working and all that, but how do I refer to my custom potion? \ I tried 'new ItemStack(Items.potionitem, 1, Potion_Manager.waterwalk.getId())' But that humorously provided "A Bungling Potion". haha waterwalk extended Potion per the tutorials. Long time Bukkit & Forge Programmer Happy to try and help
August 24, 201510 yr First, potion items don't use potion ids, but strange data values system: Bits 0-3 (1, 2, 4 and determine the potion effect. The highest legitimately available is currently 14 decimal = 1110 binary. Bits 0-5 (1, 2, 4, 8, 16, 32) determine the potion's name. If bit 5 (32) is true, the potion is a level II potion (or, in some cases, a reverted potion). If bit 6 (64) is true, the potion is an extended potion (or, in some cases, a reverted potion). Potions with bits 5 and 6 set to true cannot be brewed. Bits 13 and 14 (8192 and 16384) determines whether the potion is a drinkable potion or a splash potion. If bit 13 is true, it's drinkable. If 14 is true, it's a splash potion. Bits 7-12 and 15 are ignored, so many potions with distinct data values will have the same properties. Also, this gave you "A Bungling Potion", because... http://minecraft.gamepedia.com/Potion#Unused_potions Check out my mods: BTAM Armor sets Avoid Exploding Creepers Tools compressor Anti Id Conflict Key bindings overhaul Colourfull blocks Invisi Zones
August 24, 201510 yr Author Thanks, that explains that. I'm not the best with bit calcs. How do I specify my new custom potion for a new Itemstack? Long time Bukkit & Forge Programmer Happy to try and help
August 24, 201510 yr Thanks, that explains that. I'm not the best with bit calcs. How do I specify my new custom potion for a new Itemstack? Actually, me neither... But you can take a look at PotionHelper class, it must have a method convert effect in to meta, because it has method to convert it back... EDIT: Also, you can add effects by wrting those in to compounds in to tag list called CustomPotionEffects in stack's tag compound... Check out my mods: BTAM Armor sets Avoid Exploding Creepers Tools compressor Anti Id Conflict Key bindings overhaul Colourfull blocks Invisi Zones
August 24, 201510 yr Author I just found the NBT thing before your edit. I got a potion that delivers my effect. Name is wrong and color is wrong, but I'm sure I could fix that. All that being said, surely there is a built in way to do it?? Anyone got experience with this? Long time Bukkit & Forge Programmer Happy to try and help
August 25, 201510 yr I just found the NBT thing before your edit. I got a potion that delivers my effect. Name is wrong and color is wrong, but I'm sure I could fix that. All that being said, surely there is a built in way to do it?? Anyone got experience with this? The way to fix the color is to use metadata. That's all... Check out my mods: BTAM Armor sets Avoid Exploding Creepers Tools compressor Anti Id Conflict Key bindings overhaul Colourfull blocks Invisi Zones
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.