-
[1.7.10]Particle Entities not moving when spawned
Hello again, So I am having a throwable entity spawn some particles on impact, but when the particles spawn they all just spawn in one place and then stay there (rather than spawning in one place and then moving outwards. How would I remedy this? Here is my spawning code: public void spawnParticles(String type, int number) { for (int l = 0; l < number; ++l){ double motionX = rand.nextGaussian() * 0.02D; double motionY = rand.nextGaussian() * 0.02D; double motionZ = rand.nextGaussian() * 0.02D; this.worldObj.spawnParticle(type, this.posX, this.posY, this.posZ, motionX, motionY, motionZ); } }
-
Detecting Nearest Entity from an EntityThrowable impact
I don't know either of those... I'm kind of new to forge modding
-
Detecting Nearest Entity from an EntityThrowable impact
Hey guys, So I have a throwable entity that gets launched when a player uses an item, and when it lands (hits something, using the onImpact() method), I want to detect the nearest entity (monster, cow, chicken, player, etc.) and be able to access that specific entity's data. Is there any way to do this? (I assume I'd be using worldObj or something like that? I'm not sure). Thanks in advance!
-
[1.7.10] item consume not happening until after logout?
It might help to let you guys know that it waits until the inventory items are updated to show the change. I don't actually have to log out I just have to pick the item up and the stack size is updated.
-
[1.7.10] item consume not happening until after logout?
I've already tried checking for that, it still doesnt make a difference
-
[1.7.10] item consume not happening until after logout?
Hey there. So I have a block of code that consumes items in an ItemStack to use as ammunition. It was working great until I moved the method to a new class and now it is all wonky. The method is called on a right mouse click when the player is holding a certain item. When the player right clicks, everything else happens that is supposed to happen (there are other actions as well), but the itemstack is not reduced at all. When I right click, then exit the world and log back in, the itemstack is reduced! I am so confused, does anyone have an answer to this? Here is the method that deducts items from the itemstack (depending on how many items it should deduct): //Consumes the correct amount of items from the stack public static void consumeRunes(int consume, Item item) { int i = 0; while (consume > i) { caster.inventory.consumeInventoryItem(item); ++i; } } In this code, "caster" is a variable for the player that clicked. UPDATE: All of the items being consumed in this class only do so after logging out and then in again (even if it is just a single line calling caster.inventory.consumeInventoryItem(item) ) I have a class with a right_click listener that creates a new "spell" and then calls the "cast" method on it to cast the spell. call within the listener: if(!world.isRemote) { Spell spellToCast = new Spell(currentSpell, player); spellToCast.cast(); } in the cast method (Where it says "OBF" I've obfuscated my code because I don't want to give away more details than I have to on a public forum ;P): public static void cast() { if (name.equalsIgnoreCase("OBF")) OBF(); } method that actually acts on the itemstacks (again obfuscated): public static void OBF() { caster.inventory.consumeInventoryItem(OBF-ITEM); }
IPS spam blocked by CleanTalk.