Posted February 3, 20169 yr Alright, so I've run into a problem while trying to spawn particles. I believe I'm using the spawnParticle method correctly, as it's mostly copy/pasted from the enderpearl source code, yet I don't see any particles when I run the code (yes, my video settings are set to 'All' for particles). This is being called in an onEntityItemUpdate(...) method in a custom item class I wrote (the item has its own custom entityItem). Any help solving this conundrum would be appreciated. onEntityItemUpdate method: private int cleanTime = -1; @Override public boolean onEntityItemUpdate(EntityItem entityItem) { if (entityItem instanceof EntityEmotionDust) { EntityEmotionDust entity = (EntityEmotionDust) entityItem; if (!entity.getEntityItem().getItem().equals(EmotionModItems.empathy_dust)) { if (entity.checkAreaForBlock(Blocks.dragon_egg, 2)) { //checkAreaForBlock is a method I wrote that works fine, it isn't the issue if (cleanTime == -1) cleanTime = 40; else if (cleanTime == 0) { if (!entity.worldObj.isRemote) { for (int i = 0; i < 32; ++i) { entity.worldObj.spawnParticle(EnumParticleTypes.PORTAL, entity.posX, entity.posY + entity.random.nextDouble() * 2.0D, entity.posZ, entity.random.nextGaussian(), 0.0D, entity.random.nextGaussian(), new int[0]); } } entity.setEntityItemStack(new ItemStack(EmotionModItems.empathy_dust, entity.getEntityItem().stackSize)); } cleanTime--; } else { cleanTime = -1; } } } return false; } P.S I've tried the onEntityItemUpdate code both in that method and in the EntityItem's onUpdate method.
February 3, 20169 yr While editing ItemStack will happen on server, the particles can only spawn on client. Basically - particle is "special" (retarded) brother of normal entity and should be spawned on client, not on server. 1.7.10 is no longer supported by forge, you are on your own.
February 3, 20169 yr Author Thanks! I spawned it on the client and it worked. I modified the code from Jabelar's particle tutorial for anyone who wants to know.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.