Posted November 18, 201212 yr I want to store a booolean variable(well 2) and i want to triger it on Item rick click: i want ot store these 2: par3EntityPlayer.capabilities.isFlying = false; par3EntityPlayer.capabilities.allowFlying = true; code: package toolsPlus; import cpw.mods.fml.common.Side; import cpw.mods.fml.common.asm.SideOnly; import net.minecraft.src.CreativeTabs; import net.minecraft.src.EntityPlayer; import net.minecraft.src.Item; import net.minecraft.src.ItemStack; import net.minecraft.src.TileEntity; import net.minecraft.src.TileEntityBeacon; import net.minecraft.src.World; public class Itemenderfcoremk2 extends Item { protected Itemenderfcoremk2(int par1) { super(par1); this.setCreativeTab(CreativeTabs.tabMisc); } public TileEntity createNewTileEntity(World par1World) { return new TileEntityBeacon(); } @Override public String getTextureFile() { return "/Sheet.png"; } @SideOnly(Side.CLIENT) public boolean hasEffect(ItemStack stack) { return true; } @Override public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { if(par3EntityPlayer.experienceLevel < 40 || par3EntityPlayer.experienceLevel <= 0){ par3EntityPlayer.capabilities.allowFlying = false; par3EntityPlayer.capabilities.isFlying = false; } else if(!par3EntityPlayer.capabilities.isFlying || !par3EntityPlayer.capabilities.allowFlying){ par3EntityPlayer.capabilities.isFlying = false; par3EntityPlayer.capabilities.allowFlying = true; par3EntityPlayer.experienceLevel = par3EntityPlayer.experienceLevel - 40; } else if(par3EntityPlayer.capabilities.isFlying || par3EntityPlayer.capabilities.allowFlying){ par3EntityPlayer.capabilities.allowFlying = false; par3EntityPlayer.capabilities.isFlying = false; par3EntityPlayer.experienceLevel = par3EntityPlayer.experienceLevel + 40; } return par1ItemStack; } }
November 19, 201212 yr ((EntityPlayerMP) par3EntityPlayer).playerNetSeverHandler.handleAbilites(new Packet202PlayerAbilites(par3EntityPlayer.capabilities)) Protip: try and find answers yourself before asking on the forum. It's pretty likely that there is an answer. Was I helpful? Give me a thank you! http://bit.ly/HZ03zy[/img] Tired of waiting for mods to port to bukkit? use BukkitForge! (now with a working version of WorldEdit!)
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.