Jump to content

YoungErtu

Members
  • Posts

    61
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Location
    Leanworld
  • Personal Text
    "My Crew is World Wide." 「ヤング • エルトウ」

YoungErtu's Achievements

Stone Miner

Stone Miner (3/8)

5

Reputation

  1. No it does regenerate but I want it to only work if holding it in your hand rather than in your inventory without being selected, if that makes sense? No it does regenerate but I want it to only work if holding it in your hand rather than in your inventory without being selected, if that makes sense? Yeah but it still gives regeneration 1 even when not selected how do I change this? Also I would update to 1.9 but I just don't like the combat system changes just my preference haha thanks though. because you using the method which is always true, onUpdate is' executed every tick while the item is in the inventory. you could simply make a if statement if the player is currently holding the item, like you know if the current holding item is the current itemstack, which activates this effect.
  2. Thanks Guys, you really helped me. The Problem is i didn't have done till now, i'll need to learn that. Thanks.
  3. Hey guys, im currently working on a mod, and i want to add a Guild System, but the thing is i don't know how i could write and read the data on the server. I'll need to implement that player can create their own guilds and then i need to save all Players that are in a Guild. And if the player open the Guild Gui he can see every Player who is in the Guild. How i would get the players which are in the guild if they aren't online? Where do i need to save the data? The most of this should be done in the Guild Gui. How I need to start? Thanks for any help.
  4. this is an awesome tutorial: http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/2137055-1-7-x-1-8-customizing-packet-handling-with by coolAlias EDIT: but if you already have a packet system than write in your handle Server the code what should happen with the player, in your example he should be teleported. you need to send the x, y, z coords within the packet where the player should be teleported
  5. Fixed that by adding this into the Container: @Override public void onContainerClosed(EntityPlayer player){ World world = player.worldObj; if (!world.isRemote){ ItemStack stack = player.getCurrentEquippedItem(); inventory.writeToNBT(stack.getTagCompound()); } super.onContainerClosed(player); }
  6. I looked into a Open Source Mod and it seems that this markDirty method is wrong, he uses onContainerClosed i'll try the same, im currently working on that.
  7. I posted this under the topic of coolAlias Tutorial and here are the problems that i detected: Changed everything but still no difference, the Item Inventory is still not saved. Also when I try to set Items to the Inventory in the Item Right-Click Method it is saving the Item but when i take the item and open the inventory again it is still there. here my 2 classes inventory and container: Container Inventory thanks for your help coolAlias, maybe i understanded something wrong and this is the reason for not saving the items. EDIT: I added some debug lines and everything works fine, the NBTWriting is successful, but instead of readingNBT when opening the Inventory it writes to NBT, why? EDIT 2: Fixed ReadingNBT by putting into openInventory but it still writesNBT after opening the Inventory and reading the NBT and this several times 10 times i think. EDIT 3: writeNBT is called on Client Side when opening the inventory, but Server Side when putting Item in Slot. Reading NBT is only called on Server Side. When opening the Inventory the writeNBT method is called by markDirty, and how i said before on client side, there is something wrong but i couldn't find it. EDIT 4: I outcommented the method markDirty to put my Code into onContainerClosed but it doesn't want to work.
  8. in your method where you set the entity on fire add this: if(event.source.getSourceOfDamage() != null) event.source.getSourceOfDamage().setFire(10);
  9. try to check if the damage is by a mob. because your currently code tries to set everying burning which hurts you, but some of them are no entities so they can't be set on fire, if the player gets drown damage the source will be the water, but water is no entity so check if the damage source is by an entity.
  10. I just followed the Tutorial of coolAlias seems that this doesn't work for 1.8 or im not able to get it to work. I think i'll start the tutorial from begining.
  11. what do you want to do exactly? that could help us.
  12. but then you didn't saw this: /** * For inventories stored in ItemStacks, it is critical to implement this method * in order to write the inventory to the ItemStack's NBT whenever it changes. */ @Override public void markDirty() { for (int i = 0; i < getSizeInventory(); ++i) { if (getStackInSlot(i) != null && getStackInSlot(i).stackSize == 0) inventory[i] = null; } writeToNBT(invStack.getTagCompound()); } there is a other reason i think, but why? EDIT: When i try to shift-click the Diamond the game crashes. EDIT 2: this method is only for TileEntities i'll try to writeNBTTag and readNBTTag
  13. try this: @SubscribeEvent public void livingEvent(LivingHurtEvent event) { if(event.entityLiving instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) event.entityLiving; if(player.inventory.armorItemInSlot(3) != null && player.inventory.armorItemInSlot(3).getItem() == MODID.HELMET && player.inventory.armorItemInSlot(2) != null && player.inventory.armorItemInSlot(2).getItem() == MODID.CHESTPLATE && player.inventory.armorItemInSlot(1) != null && player.inventory.armorItemInSlot(1).getItem() == MODID.LEGGINGS && player.inventory.armorItemInSlot(0) != null && player.inventory.armorItemInSlot(0).getItem() == MODID.BOOTS) { event.source.getEntity().setFire(10); } }} this should work fine. dont try to check everything in one if statement.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.