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.

maestro1184

Members
  • Joined

  • Last visited

Everything posted by maestro1184

  1. I know java. I just hit this weird instance with an EntityThrowable not causing damage. Not sure if it is a forge bug or if something changed along the way and I missed it.
  2. The "F" isn't a variable, it is an explicit cast to a float. If I had used 20.0D, the java compiler would have recognized that value as a double. Also, this particular line of code worked fine in 1.8.9
  3. But I don't care about the kind of entity. I always want the damage to be 20.0F and that is what my code shows.
  4. But you are still just casting an int of 20 to a float. I'm just explicitly saying 20.0F.
  5. Except in that code snippet, the cast of (float)i is either 0 or 4. In my code, it is this: result.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 20.0F); Notice my code explicitly says 20.0F
  6. I don't care about sounds or particles. It's the damage the the EntityThrowable should inflict that isn't working right.
  7. I have a class that I'm trying to upgrade from 1.8.9 to 1.10.2. It's basically just a custom EntityThrowable that is a bullet for a gun. Everything is working except that the bullet causes no damage when it hits another entity. I can't figure out why since I believe this line in the onImpact method: result.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 20.0F); is correct. Does 1.10.2 handle damage differently? public class EntityBullet extends EntityThrowable { public EntityBullet(World worldIn, EntityLivingBase throwerIn) { super(worldIn, throwerIn); setHeadingFromThrower(throwerIn, throwerIn.rotationPitch, throwerIn.rotationYaw, 0.0F, 5.0F, 1.0F); } @Override protected void onImpact(RayTraceResult result) { if (this.worldObj.isRemote) { if (result.entityHit != null) { result.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 20.0F); } this.setDead(); } } @Override protected float getGravityVelocity() { return 0.005F; } }
  8. Check out the EntityRegistry.registerModEntity() method you use to register your custom entity: public static void registerModEntity(Class<? extends Entity> entityClass, String entityName, int id, Object mod, int trackingRange, int updateFrequency, boolean sendsVelocityUpdates) { instance().doModEntityRegistration(entityClass, entityName, id, mod, trackingRange, updateFrequency, sendsVelocityUpdates); } The updateFrequency argument is what you want. Lower that number and your entity will move smoother.
  9. I found this tutorial really helpful for the gun I'm working on: https://emxtutorials.wordpress.com/creating-a-gun/ I actually adjusted it a little to make it more like a hunting rifle. It's still a work in progress but I might be able to answer some questions if you have them.

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.