Jump to content
Search In
  • More options...
Find results that contain...
Find results in...


  • Posts

  • Joined

  • Last visited

Everything posted by dncwalk99

  1. Thanks Azaka7!! That worked great. Don't know why it's like that. If anyone could offer an explanation, feel free.
  2. @SubscribeEvent public void EntityViewRenderEvent(EntityViewRenderEvent.FogDensity event){ if(event.entity.isInsideOfMaterial(Material.lava)){ event.setCanceled(true); event.density = 0.5f; } } The event is getting canceled, but the new density setting it not taking effect. Any help would be appreciated.
  3. Fixed. Problem solved. Good call. Don't know how I missed it.. i have to get more sleep.
  4. Well.. no more jerking, but I get a crash. I saw the part about setting the modifier twice, and i dont think im doing that. Getting nullpointerexception. Error: ---- Minecraft Crash Report ---- // Why did you do that? Time: 10/5/13 1:55 PM Description: Saving entity NBT java.lang.NullPointerException at net.minecraft.entity.SharedMonsterAttributes.func_111262_a(SharedMonsterAttributes.java:72) at net.minecraft.entity.SharedMonsterAttributes.func_111261_a(SharedMonsterAttributes.java:56) at net.minecraft.entity.SharedMonsterAttributes.func_111257_a(SharedMonsterAttributes.java:31) at net.minecraft.entity.EntityLivingBase.writeEntityToNBT(EntityLivingBase.java:516) at net.minecraft.entity.player.EntityPlayer.writeEntityToNBT(EntityPlayer.java:1004) at net.minecraft.entity.player.EntityPlayerMP.writeEntityToNBT(EntityPlayerMP.java:213) at net.minecraft.entity.Entity.writeToNBT(Entity.java:1592) at net.minecraft.server.integrated.IntegratedPlayerList.writePlayerData(IntegratedPlayerList.java:33) at net.minecraft.server.management.ServerConfigurationManager.saveAllPlayerData(ServerConfigurationManager.java:886) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:598) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:134) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:487) at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16) Code: if (legs != null && legs.itemID == GaiaMod.GaiaLeggings.itemID) { if(atinst.getModifier(wtvID) == null) { atinst.applyModifier(mod); player.jumpMovementFactor = .05F; } } else if (legs != null && legs.itemID == GaiaMod.OmegaLeggings.itemID) { if(atinst.getModifier(wtvID) == null) { atinst.applyModifier(mod); player.jumpMovementFactor = .05F; } } else { if(atinst.getModifier(wtvID) != null) { atinst.removeModifier(mod); } } It happens after a minute or so and nothing is really standing out to me as being wrong. Confirmed. Happens when the world saves.
  5. GotoLink, you're right again. But from the forum posts about changing attributes I've managed to confuse myself. It's not imperative that I have this in my mod, but I'll keep trying to figure it out. If you feel like giving up a small example with a breakdown.. I and I'm sure others would appreciate it. Here's what I've done: AttributeInstance attributeinstance = player.getEntityAttribute(SharedMonsterAttributes.movementSpeed); attributeinstance.setAttribute(attributeinstance.getBaseValue()*3.5D); It kind of works. I get the speed, but the screen keeps jerking as though I keep sprinting off and on. Any thoughts?
  6. I keep getting a NoSuchMethod crash when I equip a piece of armor that is meant to adjust the players walk speed. I'm setting the speed in my event handler class. Is this the correct place to do it? Is there another way? @ForgeSubscribe public void onLivingUpdateEvent(LivingUpdateEvent event) { if (event.entity instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) event.entity; ItemStack helm = player.getCurrentItemOrArmor(4); ItemStack chest = player.getCurrentItemOrArmor(3); ItemStack legs = player.getCurrentItemOrArmor(2); ItemStack boots = player.getCurrentItemOrArmor(1); if (helm != null && helm.itemID == GaiaMod.GaiaHelm.itemID) { player.setAir(300); player.getFoodStats().addStats(20,5.0F); } else if (helm != null && helm.itemID == GaiaMod.OmegaHelm.itemID) { player.setAir(300); player.getFoodStats().addStats(20,5.0F); } else { } if (chest != null && chest.itemID == GaiaMod.GaiaChest.itemID) { player.capabilities.allowFlying = true; } else if (chest != null && chest.itemID == GaiaMod.OmegaChest.itemID) { player.capabilities.allowFlying = true; } else { player.capabilities.allowFlying = false; player.capabilities.isFlying = false; player.sendPlayerAbilities(); } if (legs != null && legs.itemID == GaiaMod.GaiaLeggings.itemID) { player.capabilities.setPlayerWalkSpeed(0.2F); player.jumpMovementFactor = .05F; } else if (legs != null && legs.itemID == GaiaMod.OmegaLeggings.itemID) { player.capabilities.setPlayerWalkSpeed(0.2F); player.jumpMovementFactor = .05F; } else { player.capabilities.setPlayerWalkSpeed(.1F); player.sendPlayerAbilities(); } if (boots != null && boots.itemID == GaiaMod.GaiaBoots.itemID) { player.fallDistance = 0.0F; player.stepHeight = 1.0F; } else if (boots != null && boots.itemID == GaiaMod.OmegaBoots.itemID) { player.fallDistance = 0.0F; player.stepHeight = 1.0F; } else { } } } And yes.. OP armor is OP. Not the final product.. just using extreme numbers to quickly verify if things work. Any ideas?
  7. Yep. Figured it out late last night after asking for an example. Here it is in case it helps anyone. You'll want to put this in your EventHandler class. @ForgeSubscribe public void onPlayerInteractEvent(PlayerInteractEvent event) { ItemStack inHand = event.entityPlayer.getHeldItem(); World world = MinecraftServer.getServer().worldServerForDimension(event.entityPlayer.dimension); if (inHand != null && inHand.getItem().itemID == GaiaMod.heartStoneItem.itemID) { if (inHand.getItemDamage() == 0) { if (event.action.LEFT_CLICK_BLOCK != null) { if (event.entityPlayer.worldObj.getBlockId(event.x, event.y, event.z) == Block.grass.blockID) { inHand.setItemDamage(1); EntityLightningBolt entityLightningBolt = new EntityLightningBolt(world, event.entityPlayer.posX, event.entityPlayer.posY, event.entityPlayer.posZ); world.addWeatherEffect(entityLightningBolt); event.entityPlayer.setHealth(0); //event.entityPlayer.addChatMessage(par1Str); //ModLoader.getMinecraftInstance().thePlayer.addChatMessage("Test mode: Bingo!"); } } } } } Thanks GotoLink.
  8. I created an item with metadata for 2 states. We'll call it "active" and "inactive". The item is just an item, not a food, or a tool. I need it so that when the item is used (read Left-Clicked) on a grass block, it changes from metadata 0 to 1, spawns lightning at the players position,kills the player, and shows a custom death message. I've gotten the metadata to change by using this in the items class: public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block) { if(par1ItemStack.getItemDamage() == 0) { if(par2Block.blockID == 2) { this.setDamage(par1ItemStack, 1); } //ModLoader.getMinecraftInstance().thePlayer.addChatMessage("Test mode: Bingo!"); } return 1.0F; } This does change the item from inactive to active when hitting a grass block. That's is about all the success I've had with it. I've gotten some of the other things to work, but none of them together. I've even been trying things in my event handler. Any help would be appreciated.
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.