Jump to content

colossali

Members
  • Posts

    19
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    Slender Man Mod Maker!

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

colossali's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. LivingSpawnEvent.CheckSpawn was exactly what I needed! Thank you!
  2. Thanks for the reply. I've checked in debug mode and the code is firing. It seems this sets a limit to spawn per chunk, while I'm looking for a limit for the entire world, like there being only one persistent EnderDragon
  3. Hi, I'm trying to set a maximum spawn limit to an entity, here's my code but I can't seem to get it to work. The event handler is registered in the main mod class. @SubscribeEvent public void maxNessieSpawn(LivingPackSizeEvent event){ if(event.entityLiving instanceof EntityNessie){ event.maxPackSize = 1; event.setResult(Result.ALLOW); } }
  4. Thanks! By removing the Client only code and implementing IEntityAdditionalSpawnData the problem was fixed! Thank you so much!
  5. I've not been able to figure out what's causing my throwable entity to lose the player as the owner. AFAIK I'm doing it all correctly. Here's the code: EntityRegistration EntityRegistry.registerModEntity(EntityWebString.class, "Web String", webStringID, this, 128, 10, true); EntityThrowable public class EntityWebString extends EntityThrowable{ public EntityPlayer spiderMan; public EntityWebString(World world){ super(world); this.spiderMan = (EntityPlayer) this.getThrower(); } public EntityWebString(World world, EntityLivingBase throwingEntity) { super(world, throwingEntity); this.spiderMan = (EntityPlayer) throwingEntity; this.ignoreFrustumCheck = true; this.setSize(0.1F, 0.1F); this.motionX *= 2F; this.motionZ *= 2F; this.motionY *= 2F; SuperHeroLogger.debug("Spawned String with owner:" + spiderMan); } @Override protected float getGravityVelocity() { return 0.03F; } @Override public void onUpdate() { super.onUpdate(); } protected void onImpact(MovingObjectPosition hitPos) { SuperHeroLogger.debug("Object String: " + hitPos.hitInfo); SuperHeroLogger.debug("Owner is: " + this.spiderMan); SuperHeroLogger.debug("Owner is: " + this.getThrower()); if(hitPos.typeOfHit == MovingObjectType.ENTITY){ SuperHeroLogger.debug("Object Hit by String: " + hitPos.entityHit.toString()); hitPos.entityHit.motionX = -0.75F * this.motionX; hitPos.entityHit.motionZ = -0.75F * this.motionZ; hitPos.entityHit.motionY += 0.5F; this.setDead(); } else if(hitPos.typeOfHit == MovingObjectType.BLOCK){ if(!Keyboard.isKeyDown(42)){ try{ SuperHeroLogger.debug("Block Hit by String: " + hitPos.blockX + "x, " + hitPos.blockZ + "z, " + hitPos.blockY + "y"); this.spiderMan.motionX = 2F * this.motionX; this.spiderMan.motionZ = 2F * this.motionZ; this.spiderMan.motionY = (double)(4.0F * -MathHelper.sin(this.spiderMan.rotationPitch / 180.0F * (float)Math.PI)); } catch(NullPointerException e){ SuperHeroLogger.error(e.getMessage()); e.printStackTrace(); } } this.setDead(); } } } Item Right click code @Override public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { EntityWebString string = new EntityWebString(world, player); switch (shotType){ case 0: if(player.inventory.hasItem(SpiderMan.webString)){ if(!world.isRemote){ world.spawnEntityInWorld(string); } player.inventory.consumeInventoryItem(SpiderMan.webString); } break; case 1: if (player.inventory.hasItem(SpiderMan.webBall)){ if(!world.isRemote){ world.spawnEntityInWorld(new EntityWebBallNew(world, player)); } player.inventory.consumeInventoryItem(SpiderMan.webBall); } break; } return super.onItemRightClick(itemStack, world, player); } Log Output [15:06:30] [Client thread/ERROR] [dg_shc]: Spawned String with owner:EntityClientPlayerMP['rara_avia'/268, l='MpServer', x=-260.85, y=68.62, z=226.77] [15:06:30] [server thread/ERROR] [dg_shc]: Spawned String with owner:EntityPlayerMP['rara_avia'/268, l='New World', x=-260.85, y=67.00, z=226.77] [15:06:30] [Client thread/ERROR] [dg_shc]: Owner is: null [15:06:30] [Client thread/ERROR] [dg_shc]: Owner is: null [15:06:30] [Client thread/ERROR] [dg_shc]: null [15:06:30] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: java.lang.NullPointerException [15:06:30] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.dudgames.spiderman.entities.EntityWebString.onImpact(EntityWebString.java:64) [15:06:30] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.entity.projectile.EntityThrowable.onUpdate(EntityThrowable.java:229) [15:06:30] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.dudgames.spiderman.entities.EntityWebString.onUpdate(EntityWebString.java:45) [15:06:30] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2298) [15:06:30] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.world.World.updateEntity(World.java:2258) [15:06:30] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.world.World.updateEntities(World.java:2108) [15:06:30] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.client.Minecraft.runTick(Minecraft.java:2097) [15:06:30] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1039) [15:06:30] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.client.Minecraft.run(Minecraft.java:962) [15:06:30] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.client.main.Main.main(Main.java:164) [15:06:30] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [15:06:30] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [15:06:30] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [15:06:30] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at java.lang.reflect.Method.invoke(Unknown Source) [15:06:30] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [15:06:30] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [15:06:30] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [15:06:30] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at GradleStart.main(Unknown Source) [15:06:30] [server thread/ERROR] [dg_shc]: Owner is: EntityPlayerMP['rara_avia'/268, l='New World', x=-260.85, y=67.00, z=226.77] [15:06:30] [server thread/ERROR] [dg_shc]: Owner is: EntityPlayerMP['rara_avia'/268, l='New World', x=-260.85, y=67.00, z=226.77]
  6. I'm having a similar problem, have you ever found a solution?
  7. If you're using 1.6.2 then "rayTraceBlocks" is now "clip" Try that now.
  8. Nevermind found it! Just had to call renderplayer.name_tag_range = blah blah
  9. I have a 5 on one of my items and it works, so it must be the maxstacksize!
  10. Hi, I'm working on an SMP mod in which I want to disable the username render tag distance for anyone wearing a certain armour. Now, I was leafing throught the Minecraft Forge github and saw a "Changeable name tag render distance " commit, but didn't understand the code... could anyone explain to me how I could use this?
  11. Would that change the colour of both the icon for the Armor and the armor itself or is it just one of them? Also wouldn't the custom renderer then have to override the base one?
  12. Oooh that sounds like a good plan! Thanks! I'll try it out next time I get the chance and tell you if it worked!
  13. Oh right, that sounds like a plausible plan! I'm crap at that kinda stuff though, any example as to what code/ methods to use?
  14. I found the problem, I had certain code in the Entity AI file that used rayTrace to see if the entity was in the field of view of the player. I wanna keep that, does anyone think I could move that method into the client tick handler or some other handler and still get it to work? If yes, then any ideas as to how?...
  15. var3.rayTrace(200, 1.0F).blockX var3 is entityplayer 200 is "reach" so if you want you can have the raytrace work for let's say 100 blocks, change that to 100 edit: I'm awful at explaining, so here's my code, it's easy to figure out (I'm telling minecraft to send a packet to the location I'm looking at with the variables positionx positiony positionz and strength) if (var2.currentScreen == null && !Keyboard.isKeyDown(pulseboltKey) && pulseboltKeyDown) { this.sendExplosion((int)var3.rayTrace(200, 1.0F).blockX, (int)var3.rayTrace(200, 1.0F).blockY, (int)var3.rayTrace(200, 1.0F).blockZ, 6); this.explosionTimer = 0; }
×
×
  • Create New...

Important Information

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