
Lua
Members-
Posts
191 -
Joined
-
Last visited
Everything posted by Lua
-
Hi, I like many people are having trouble running the client. Here are my Run Configs: Main Class: net.minecraft.launchwrapper.Launch Program Arguments: --version 1.7.2 --tweakClass cpw.mods.fml.common.launcher.FMLTweaker --accessToken OreSpiders VM Arguments: -Dfml.ignoreInvalidMinecraftCertificates=true Forge Version: 7.2.30.982 for Minecraft 1.7.2 Error: EDIT: I had to change the path of the libraries of lwjgl, it was looking in the wrong place.
-
@TGG The second super is just a filler whilst I figure out what potion to add. The game doesn't actually crash so won't breakpoints be useless? What do you mean by logging statements?
-
Hi, So I'm here again, requesting further help on this entity, although the past two times I managed to work the problem out myself. But this, this one is just weird. I'm not sure if its me, or mc code. Anway, this mp4 describes the problem. http://gyazo.com/7077bbd220c167afdff66df647b84659 This only happens if you stand in a specific position, and it can sometimes happen when it trys to jump and hit you. As you can see, the mob is clearly hitting the player but the player isn't taking damage. I must stress, this is only if you stand like this, most of the time you wouldn't notice it in combat. Could this minecrafts bad attacking AI's fault? Anyway, just to be certain, my codes below for you to check over. package mcub.entities; import net.minecraft.client.Minecraft; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.boss.IBossDisplayData; import net.minecraft.entity.monster.EntitySpider; import net.minecraft.util.DamageSource; import net.minecraft.world.World; public class OS_EntityQueenSpider extends EntitySpider implements IBossDisplayData { private int healAtDifferentDifficulties; public OS_EntityQueenSpider(World world) { super(world); this.setSize(2.8F, 1.5F); this.isImmuneToFire = true; this.experienceValue = 100; } @Override protected void applyEntityAttributes() { super.applyEntityAttributes(); this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(100.0D); this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(1.99900011920929D); this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setAttribute(9.0D); this.getEntityAttribute(SharedMonsterAttributes.followRange).setAttribute(40.0D); this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).setAttribute(1.0); } private void playHealthEffect() { for(int i = 0; i < 4; ++i) { double d0 = this.rand.nextGaussian() * 0.02D; double d1 = this.rand.nextGaussian() * 0.02D; double d2 = this.rand.nextGaussian() * 0.02D; this.worldObj.spawnParticle("heart", this.posX + (double) (this.rand.nextFloat() * this.width * 2.0F) - (double) this.width, this.posY + 0.5D + (double) (this.rand.nextFloat() * this.height), this.posZ + (double) (this.rand.nextFloat() * this.width * 2.0F) - (double) this.width, d0, d1, d2); } } //Removed the check for daylight. @Override protected Entity findPlayerToAttack() { return this.worldObj.getClosestVulnerablePlayerToEntity(this, 40); } @Override public boolean attackEntityAsMob(Entity ent) { if(super.attackEntityAsMob(ent)) { if(ent instanceof EntityLivingBase) { //TODO add potion super.attackEntityAsMob(ent); } return true; } else { return false; } } @Override public void onLivingUpdate() { switch(Minecraft.getMinecraft().gameSettings.difficulty) { case 1: healAtDifferentDifficulties = 20; break; case 2: healAtDifferentDifficulties = 40; break; case 3: healAtDifferentDifficulties = 60; break; } if(this.getHealth() < healAtDifferentDifficulties && this.ticksExisted % 20 == 0) { this.heal(2.0F); playHealthEffect(); } super.onLivingUpdate(); } @Override public void onDeath(DamageSource damageSource) { OS_EntityEnderSpider enderSpider = new OS_EntityEnderSpider(this.worldObj); enderSpider.setPosition(this.posX, this.posY, this.posZ); this.worldObj.spawnEntityInWorld(enderSpider); } } Results from my debugging: - It's not because I'm extending EntitySpider - It's not because i've up-scaled the mob. - It's not because of the onLivingUpdate method somehow causing it to bug out. The chance of it being a hitbox problem crossed my mind too, so heres a picture of the mobs hitbox. http://gyazo.com/37d0d67b0fc30eea7a560cedde63f1c3
-
@TGG I didn't notice that before, anyway, I managed to solve it on my own with some logic and thinking. Thanks anyway.
-
Hi, I'm using the dropFewItems method and Im making it have a 1/2 chance of the coal dropping with 1-3 pieces However, if it has looting, then amountToDrop gets timed by the lootenchantment. Which is the part which isn't working. The loot enchantment. I looked at the call of the method and lootEnchantLevel is just set to 0. How does it get the actual looting enchantment level. Code: /** * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param * par2 - Level of Looting used to kill this mob. */ @Override protected void dropFewItems(boolean hitByPlayer, int lootEnchantLevel) { super.dropFewItems(hitByPlayer, lootEnchantLevel); int ranNum, amountToDrop; ranNum = this.rand.nextInt(2); amountToDrop = this.rand.nextInt(3 + 1); if(! (this.isBurning())) { if(lootEnchantLevel == 0) { if(ranNum == 1) { this.dropItem(Item.coal.itemID, amountToDrop); } } else { this.dropItem(Item.coal.itemID, amountToDrop * lootEnchantLevel); } this.dropItem(Item.spiderEye.itemID, 1); } }
-
@Saxon564 I dont understand? EDIT: Nevermind, I've solved the rest of my spawning problems!
-
@Draco18s Okay, thanks for the other help! @GotoLink Is my way for checking for obsidian a bad way? I know obsidian is pretty rare, but where else would an obsidian spider spawn . My spawn rates for my mobs are pretty high, but they all seem too rare still. Hm
-
So how does making sure the boundingbox is less than 63 make it spawn underground? Whats the bounding box got to do with if it can spawn underground. How does that work The bounding box thing is Mojang code. However, the bounding box minY just so conveniently happens to also bethe mob's posY[/u]. If the mob's posY is less than 63, then it's HIGHLY LIKELY that the mob is underground. What with ground being 63 and up or covered in water (and thus not a valid spawn location). Ah, I understood the logic, but I wasn't aware that you could you use the bounding box Y as the the entities Y. Thanks for clearing that up. The mobs are kinda rare though, is my weighted probability and mix max group numbers a bad combination or something? The code is in my previous post.
-
Okay, i've added spawning conditions, but they seem to rare, are my numbers wrong for my add spawns? What would a good example be? Heres one of mine EntityRegistry.addSpawn(OS_EntityIronSpider.class, 16, 2, 4, EnumCreatureType.monster, BiomeGenBase.desert, BiomeGenBase.desertHills, BiomeGenBase.extremeHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.frozenOcean, BiomeGenBase.frozenRiver, BiomeGenBase.iceMountains, BiomeGenBase.icePlains, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.plains, BiomeGenBase.swampland, BiomeGenBase.taiga, BiomeGenBase.taigaHills); @Cyan This is how I check for a block, I bet theres a method to check for a material somewhere in the world class. @Override public boolean getCanSpawnHere() { for(int x = 0; x < 16; x++) { for(int y = 0; y < 8; y++) { for(int z = 0; z < 16; z++) { int x1 = MathHelper.floor_double(this.posX + x - ; int y1 = MathHelper.floor_double(this.posY + y - 4); int z1 = MathHelper.floor_double(this.posZ + z - ; if(this.worldObj.getBlockId(x1, y1, z1) == Block.obsidian.blockID) { System.out.println("Spawning Obsidian Spider:" + "X:" + this.posX + " Y:" + this.posY + " Z:" + this.posZ); return super.getCanSpawnHere(); } } } } return false; }
-
So how does making sure the boundingbox is less than 63 make it spawn underground? Whats the bounding box got to do with if it can spawn underground. How does that work
-
What's vanilla's ground height? (Hint: it's 63) Also, what else do you have access to? (Hint: the mob's posY) Yes, I saw that, but i is set to the boundingbox? Isn't the boundingbox the hit box?
-
Hm, I dont think I understand. Why does it use the calender along with Minecrafts Time? To make sure its night? But then how does it check if its underground still Ignore that part and look at the REST of the function. (Oh, and the Calendar is checking to see if the real world date is Halloween) From what I can tell, it checks if the boundingbox is greater or equal to than 63 and if it is, then no spawn. Then it goes on to getting the light level and the pos of x and z. I dont get how that stops it from spawning above ground?
-
Hm, I dont think I understand. Why does it use the calender along with Minecrafts Time? To make sure its night? But then how does it check if its underground still
-
Hi, I'm looking for some help on spawning mob if a condition is true. After a short search in the slime class, I found getCanSpawnHere(), which, obviously, I'll need to use. I'm trying to make the mob spawn at a certain Y level and lower. But im not sure how too. Maybe I'd need to get the pos of the chunk or something? Not sure.
-
What is EntityOreSpider.getEntity() supposed to ever return other than null? Why are the spiderTypes non-static? Advice taken.
-
Hm, why not point out what I did wrong?
-
Hi, I'm creating a single entity but it each spawn of it will be different, texture, drop etc. Im going to be doing all based on the 'type' of it. Which is just a string. To give each entity a type on spawn, I decided to use the on entity constructing event and then gave the string 'spiderType' a random index of an array I have. Anyway, I get a NPE EntityOreSpider.getEntity().spiderType = EntityOreSpider.getEntity().spiderTypes[rand.nextInt(EntityOreSpider.getEntity().spiderTypes.length)]; And heres the full code. Event Class: package mcub.helpers; import java.util.Random; import mcub.entities.EntityOreSpider; import net.minecraftforge.event.ForgeSubscribe; import net.minecraftforge.event.entity.EntityEvent.EntityConstructing; public class ForgeEvents { private Random rand = new Random(); @ForgeSubscribe public void oreSpiderConstruct(EntityConstructing event) { if(event.entity instanceof EntityOreSpider) { EntityOreSpider.getEntity().spiderType = EntityOreSpider.getEntity().spiderTypes[rand.nextInt(EntityOreSpider.getEntity().spiderTypes.length)]; if(EntityOreSpider.getEntity().spiderType == "diamond") { System.out.println("diamnd"); } else if(EntityOreSpider.getEntity().spiderType == "gold") { System.out.println("gold"); } else { System.out.println("null"); } } } } Entity Class: package mcub.entities; import net.minecraft.client.Minecraft; import net.minecraft.entity.monster.EntitySpider; import net.minecraft.world.World; public class EntityOreSpider extends EntitySpider { private static EntityOreSpider spider; public String[] spiderTypes = {"diamond", "gold"}; public String spiderType; public EntityOreSpider(World world) { super(world); } public static EntityOreSpider getEntity() { return spider; } }
-
Hi, Im looking to generate a structure, but before I do, I want to know if its a good idea(Because of the size) I've already got some modders opinions on generating it, but I feel if I post here, Ill be able to reach a wider audience. So yeah, I used a schematic to java tool , and found out its over 30,0000 setBlocks. From this, I found that if I was to generate it, schematic to java would not be the way. A schematic importer, would be more favorable. However, would it actually be favourable? Or should I just not attempt to generate it b'cos of the size. If so, please could you explain to me why, Minecraft/Java can't handle this structure. The structure. Ignore the mob.
-
Hm. I thought Id get a pretty straight answer since I thought people would of asked how before
-
^^^Any idea about the persistence of player props
-
Ive noticed Iextendedplayerprops persists through worlds. How can I change this? I need it to be unique to each world. Also, since the value im saving is client side, i need to send it to the server( I think) so hacked clients cant change it. I do this by packet handling, the only packet handling ive did before is sending items, maybe im over complicating this but, how would I send a simple boolean to the server?
-
Programming Languages are usually universal, meaning once you've learned one and you're pretty good with it, you should easily be able to pick up a new one and learn its syntax within a matter of weeks. Regarding your question, you need to use the entity interact event, just follow that tutorial and understand it(the one diesieben07 linked) and you should be good to go
-
Solved, I had to call the method in pre-init.
-
Hi, I added achievements and in eclipse it works fine. However, after I've exported it and then got the achievement in REAL Minecraft and then closed the game and started the game up again. I get this crash log : Heres my achievement code: I call the method in my init method.
-
[SOLVED] Custom Music in Custom Dimension WONT WORK !!!
Lua replied to Heltrato's topic in Modder Support
As ^^ Says as simpler way would be to use event.manager.addMusic("ac:Welcome To The Cold.wav"); in your soundevent class, it checks for the file in a 'music' folder in your assets