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.

jmeyer2k

Members
  • Joined

  • Last visited

  1. Cool thanks, I'll try that.
  2. Bump... Where's Lex when you need him? :l
  3. I would love the Forge Modder tag under my name. I develop MobLoot (https://github.com/jmeyer2k/MobLoot). MobLoot is a mod where you have to collect loot from a zombie's dead body when you kill it. The loot includes the regular drops and also some other configurable random items.
  4. When a mob dies, I want this mob to spawn as an exact replica of the mob but with my own AI. This means I want it to copy the rendering function of the mob that died. In EntityDeadMob.java, when the mob is spawned, the entityToDisplay variable is set as well as the position. When I run it with this code, I get an error. EntityDeadMob.java package com.julianscode.mobloot; import net.minecraft.entity.Entity; import net.minecraft.entity.monster.EntityMob; import net.minecraft.world.World; public class EntityDeadMob extends EntityMob { public Entity entityToDisplay; public EntityDeadMob(World p_i1738_1_) { super(p_i1738_1_); // TODO Auto-generated constructor stub } } RenderDeadMob.java package com.julianscode.mobloot; import cpw.mods.fml.client.registry.RenderingRegistry; import net.minecraft.client.renderer.entity.Render; import net.minecraft.entity.Entity; import net.minecraft.util.ResourceLocation; import net.minecraft.client.renderer.entity.RenderManager; public class RenderDeadMob extends Render { Render display; @Override public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) { EntityDeadMob deadmob = (EntityDeadMob) p_76986_1_; this.display = RenderManager.instance.getEntityRenderObject(deadmob.entityToDisplay); this.display.doRender(deadmob.entityToDisplay, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_); } @Override protected ResourceLocation getEntityTexture(Entity p_110775_1_) { return null; } } Error: net.minecraft.util.ReportedException: Rendering entity in world at net.minecraft.client.renderer.entity.RenderManager.func_147939_a(RenderManager.java:346) ~[RenderManager.class:?] at net.minecraft.client.renderer.entity.RenderManager.renderEntityStatic(RenderManager.java:278) ~[RenderManager.class:?] at net.minecraft.client.renderer.entity.RenderManager.renderEntitySimple(RenderManager.java:251) ~[RenderManager.class:?] at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:533) ~[RenderGlobal.class:?] at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1308) ~[EntityRenderer.class:?] at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1095) ~[EntityRenderer.class:?] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1066) ~[Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:961) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:164) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_51] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_51] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_51] at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_51] at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_51] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_51] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_51] at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_51] at GradleStart.bounce(GradleStart.java:107) [start/:?] at GradleStart.startClient(GradleStart.java:100) [start/:?] at GradleStart.main(GradleStart.java:55) [start/:?] Caused by: java.lang.NullPointerException at net.minecraft.client.renderer.entity.RenderManager.getEntityRenderObject(RenderManager.java:207) ~[RenderManager.class:?] at com.julianscode.mobloot.RenderDeadMob.doRender(RenderDeadMob.java:18) ~[RenderDeadMob.class:?] at net.minecraft.client.renderer.entity.RenderManager.func_147939_a(RenderManager.java:300) ~[RenderManager.class:?] ... 21 more Event where entity is spawned: @SubscribeEvent public void onLivingDeathEvent(LivingDeathEvent event) { if(event.entityLiving instanceof EntityMob && event.source.getEntity() instanceof EntityPlayer) { log.info("Killed Hostile Mob "); double x = event.entityLiving.posX; double y = event.entityLiving.posY; double z = event.entityLiving.posZ; World w = event.entityLiving.worldObj; this.spawnDeadZombie(x, y, z, w, (Entity) event.entityLiving); } }
  5. Ok I see. Thank you very much. Is there any way I send a function to the server. Currently I am using keybinds so it makes sense it is not on the server side.
  6. setBlock does not seem to be changing the blocks when I save and quit and then start up again. They show fine in the session, but they disappear if I relog. Is there anyway to fix this?
  7. Hmm, It still repeats if I hold down on the right mouse button. I'm not sure if this has anything to do with it, but I'm in creative mode.
  8. How can I make it so that when the user holds right click, onItemRightClick doesn't get called multiple times? Is there any built in function or would I have to program a lock manually? If I need to program it manually, how would I go about doing so?

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.