Jump to content

Coron

Members
  • Posts

    12
  • Joined

  • Last visited

Everything posted by Coron

  1. This returns 0: new ItemStack(Items.DIAMOND_SWORD).getItemDamage(); How come? It should return 6 which is the attack damage of a diamond sword. Edit: Nevermind, this is probably how much the stack has been damaged and not the attack damage.
  2. Was not aware of the need to add it to the render, but of course that was it, thanks. For those with the same issue, I added the following to the constructor of my render: this.addLayer(new LayerHeldItem(this));
  3. Whenever my entity, which extends EntityCreature, is spawned, I run the following: this.setItemStackToSlot(EntityEquipmentSlot.HEAD, new ItemStack(Blocks.PUMPKIN)); But it seemingly has no effect. I've also tried to run it a while after it has spawned and confirmed that is does execute. However, my entity still does not equip anything. I've also tried equipping it with a sword, but that also has no effect.
  4. I'm implementing a language for robot development in Minecraft and I want to add syntax highlighting to my language. This could be accomplished tediously by drawing each syntactic element with proper spacing, but I would prefer to just draw one string (or a string per visible line) with multiple colors in one string. This is possible to do with chat messages, but can it accomplished when drawing strings directly?
  5. Makes sense. I've been working with modding/Forge for less than 24h, so I really had no idea Do the instances share any identifiers across the sides?
  6. I'm working on a mod that spawns custom entities. I spawn an entity by constructing it and calling world.spawnEntity(). I wanted to give my entities unique names and in doing so I discovered that the constructor is actually being called twice. If I modify the parameters of the constructor, I get an exception that traces back to: net.minecraftforge.fml.common.network.internal.EntitySpawnHandler.spawnEntity(EntitySpawnHandler.java:144) What confused me even more is that even if the constructor isn't called a second time, the entity can still carry out actions but it will be invisible. Does the client construct a client for logic and visuals? Is there a way I can ensure that only one entity is constructed? Thanks! edit: Apparently not a problem when WorldClient spawns the entity, although still not sure why!
  7. I've exposed that capability and it works fine if I manually insert items into its inventory, but it still does not pickup items that are nearby. Do I need to override a method?
  8. I'm working on an entity (which extends EntityCreature) that should have its own inventory and be able to pick up items. Only thing I've got down so far is calling setCanPickUpLoot(true). I've seen some previously examples, but they are seemingly outdated. How is this achieved in 1.11?
  9. Good point, looks better now. But now I realize that what I actually might want is for the entity to turn towards the block, any idea on how to do that?
  10. I've managed to get it working as a temporary solution for the script to wait for the tick and then make the tick wait for the current command to execute. Obviously not a good long term solution, but fine at the moment. That's a good point, but I want to use Java (or bytecode) as I will be implementing a compiler that either compiles to Java or bytecode.
  11. I'm working on a robot which mines in a set direction. I want the robot to look at a block before mining it. I've tried using entity.getLookHelper().setLookPosition(position.getX(), position.getY(), position.getZ(), 10.0F, 10.0F); The entity moves its head towards the block, but not all the way. How can I make the entity look at the block properly?
  12. I'm working on a forge mod in which it is possible to compile and run (Java) scripts at runtime. It is possible to manipulate a robot, for example by making it walk to a set of coordinates or mine in a direction. The script runs on a separate thread from the game, but this causes some occasional crashes since the script may indirectly modify collections while they are being iterated. The solution to this, I think, would be that every command executed by the script would have to wait for the next game tick to execute. I know whenever the game ticks, because the robot's onEntityUpdate() is called. I'm new to Java and I've looked into synchronization, but I'm not sure what an actual implementation would look like, so I would greatly appreciate some help!
×
×
  • Create New...

Important Information

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