Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

ArtisanGaming

Members
  • Joined

  • Last visited

  1. 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); } }
  2. I don't know either of those... I'm kind of new to forge modding
  3. 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!
  4. 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.
  5. I've already tried checking for that, it still doesnt make a difference
  6. 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); }

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.