Jump to content

KnightDemon

Members
  • Posts

    8
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

KnightDemon's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I've already got it set up and working, I really only wanted professional opinion on whether a separate inventory file would be more beneficial over an entity with an implemented inventory. 1. working on 1.8.9, I'll take your advice and update to an even newer forge version then. 2. The inventory will only be assigned to the custom entity, there will be many of that entity spawned but only that type.
  2. Hello there, I'm in the process of updating a mod to a newer forge, and whilst looking over the code I've wrote (A friend helped with some of it), I've noticed that I have a weird thing going on. I have a custom entity and I have given it an Inventory inside it's build class. My friend created an extended entities properties file to help accommodate an inventory, the weird thing is that he also created a separate Inventory file. My question is, would it be simpler to have the inventory be in the build class of the custom entity or have it separate in it's own file? I ask as in the build class the entity would extend from EntityLivingBase and therefore inherit the functions for changing items in the inventory etc. and would auto-update the render too (i think? different problem, another time). Any experienced guidance on this would be appreciated.
  3. Hello there, I've got a 1.7.10 mod I've worked on a while, I'll be updating it to a newer forge but only after I've got this one little "bug" fixed. I don't want to give out code, if anything I more so want a push in the right direction of where to look. My problem is that I have a custom entity that has modular armour that can be equipped, it does this by having an inventory with slots. I have the entity working fine, it has a GUI for it's inventory and I can change the armour around and have it render fine. The actual issue is when I relog or have a second player log in (this is all in the test forge). When you open the inventory of the entity, the model and render does update and you can see the armour, if you don't ever look inside the inventory, it's just a plain old entity without the armour. I think my issue is a desync error and I would need a packet to send the information about the contents of the inventory to the players in render distance of the entity. I have nearly zero knowledge of packets so that's a problem straight away. If anyone has thought's please let me know. As a last note, the way the inventory is saved is through an Extended Entities file and it doesn't use datawatchers, I have a feeling that if I used datawatchers then I wouldn't have enough of them for other things AND it wouldn't work with the inventory / container / gui etc. but I have no definite clue on that.
  4. Are you 100% certain that's the only way to go about it? Alrighty, so block bounds will need to be smaller.. but how do i get it to render as the full block even though I change the blocks bounds. I couldn't work that bit out either
  5. Hello all. Now this may sound like a trivial thing, however, what I'm trying to do is create a block that can be climbed like ladders and is a full 1m cube, a normal block size. Think of the spider pushing itself against a block, however I have searched through the vanilla code and discovered that when an entity is climbing, it passes through "isOnLadder" in EntityLivingBase or through "isLivingOnLadder" in ForgeHooks. Now I'm a novice when it comes to java so I won't even attempt to say I know what this does. During my Google searches and my vanilla code search, I know that the Ladder block calls "isLadder()" to set it as a ladder, even in the description of that method it says it makes things climbable. Before anyone says I haven't called it correctly or something, I have tested on changing the block bounds for my block and when I do that, the effect works. I can climb it, but when it's a full 1m cube, so minimum block bounds being 0.0, and max bound is 1.0, it won't work. Is there a way to make it work. I'm guessing the trouble is because the player isn't inside the block bounds of the block to climb on them, however I know that it should be possible to make a full 1m cube climbable as it's been done in other mods before now. Can anyone provide any help with this matter? As an added note, my block does have a corresponding TileEntity, and it extends BlockContainer as such.
  6. Well thank you for getting back to this TheGreyGhost, although your suggestions were quite informal, it didn't seem to work for me. I possibly didn't do it right, but it just didn't seem to affect the player. I'm thinking that a custom enchantment might work, but then again, I don't have any clue how to make a custom enchantment either. If anyone in future can figure out a way to cause the player to sink in water. (regardless of how) then I would appreciate knowing about it. I can trigger it in onUpdate for the item, if it triggers for the player I'm not sure... but it does through the item so it could work. Thank you to you both for helping.
  7. Already mentioned that part, (might have missed specifics) I've ran an if to check the player is in water. It outputs a message (for now) saying it is and such, it's just either turning off the swimming stuff the player can use or forcing the player's movement to be down so it can't swim up. public void onUpdate(ItemStack itemstack, World world, Entity entity, int par4, boolean inHand) { if (!world.isRemote) { if (entity instanceof EntityPlayer) { if (inHand) { ((EntityPlayer) entity).addChatComponentMessage(new ChatComponentTranslation("Is in hand!")); if(entity.isInWater()) { ((EntityPlayer) entity).addChatComponentMessage(new ChatComponentTranslation("Is in water")); this.sinkInWater((EntityPlayer) entity, itemstack, world); } } } } super.onUpdate(itemstack, world, entity, par4, inHand); } that's what I have. Where it says this.sinkInWater is just a reference to a method i was using to allow me to change just stuff in there instead of the onUpdate method.
  8. Hello there, first post, so sorry if anything's against the rules. I have an item set up that works fine, I would however like it to do something special. I would like it to make the player sink in water so that it will act like an Iron Golem or a slime (these are bad examples as they don't have the AI to swim which makes them "sink"). I was thinking of a way to have it trigger, however I can't seem to make the player sink in the water. I've got the if statements set up in an "onUpdate" method for the item to have that trigger. I've tested to make sure that it triggers correctly by adding some print statements which it does. I have tried to make the player's motionY be changed but it isn't affected or just not working. Any help on this would be appreciated. So can anyone help me? If you're confused as to what I mean I'll try to make my explanation better.
×
×
  • Create New...

Important Information

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