
WillR27398
Members-
Posts
20 -
Joined
-
Last visited
Everything posted by WillR27398
-
Whenever I spawn my entity, the hitbox is always misaligned by maybe 1 block until it moves or you interact with the incorrect hitbox. Wondering if anyone knew what the cause is? I can post any code if needed, thanks.
-
Okay, I sort of figured as much, but wasn't too sure whether there was a way around it or not. I will just redo some of the logic then in the AI code, thanks.
-
So I want my entity to be able to swap out its AI so that it can go from doing one thing to another, however, in doing this it seems to cause a ConcurrentModificationException: at java.util.LinkedHashMap$LinkedHashIterator.nextNode(LinkedHashMap.java:719) at java.util.LinkedHashMap$LinkedKeyIterator.next(LinkedHashMap.java:742) at net.minecraft.entity.ai.EntityAITasks.onUpdateTasks(EntityAITasks.java:70) at net.minecraft.entity.EntityLiving.updateEntityActionState(EntityLiving.java:846) at net.minecraft.entity.EntityLivingBase.onLivingUpdate(EntityLivingBase.java:2470) at net.minecraft.entity.EntityLiving.onLivingUpdate(EntityLiving.java:640) at net.minecraft.entity.EntityAgeable.onLivingUpdate(EntityAgeable.java:194) at net.minecraft.entity.passive.EntityAnimal.onLivingUpdate(EntityAnimal.java:46) at willr27.blocklings.entity.EntityBlockling.onLivingUpdate(EntityBlockling.java:894) at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:2296) at net.minecraft.entity.EntityLiving.onUpdate(EntityLiving.java:344) at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2117) at net.minecraft.world.WorldServer.updateEntityWithOptionalForce(WorldServer.java:876) at net.minecraft.world.World.updateEntity(World.java:2083) I can never get this to replicate consistently so seems somewhat random to me at the moment. Just wondering if anyone has come across this before? I'm just using addTask(...) and removeTask(...) to add and remove the AI.
-
Ah, okay, thank you!
-
I was wondering how to add potions into recipes. I have been using: PotionUtils.addPotionToItemStack(new ItemStack(Items.POTIONITEM), PotionTypes.LEAPING) But no matter the type, they are just generic potion items, so all potions can be used in recipe.
-
[1.11.2] getBiomes() not Returning Anything
WillR27398 replied to WillR27398's topic in Modder Support
The BiomeDictionary doesn't seem to be working, but using Biomes.PLAINS etc is working. -
Calling BiomeDictionary.getBiomes(Type.PLAINS), or for any other type, returns an empty array. Is this a bug in 1.11.2 or something else? Edit: Am now checking import to see if that was the problem, currently using net.minecraftforge.common.BiomeDictionary.Type Edie2: Import is not the issue it seems
-
[1.10.2] Server Crashes with NoSuchMethodError
WillR27398 replied to WillR27398's topic in Modder Support
Oh, I see the problem. Hopefully I can fix any problems I have now, thanks! -
My mod works fine in single player, but when trying to create a server, this method apparently doesn't exist anymore in my entity class: getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).removeAllModifiers(); Ticking entity java.lang.NoSuchMethodError: net.minecraft.entity.ai.attributes.IAttributeInstance.func_142049_d()V at com.test.entity.EntityCustom.updateStats(EntityCustom.java:805) at com.test.entity.EntityCustom.func_70071_h_(EntityCustom.java:533) at net.minecraft.world.World.func_72866_a(World.java:1964) at net.minecraft.world.WorldServer.func_72866_a(WorldServer.java:838) at net.minecraft.world.World.func_72870_g(World.java:1934) at net.minecraft.world.World.func_72939_s(World.java:1750) at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:619) at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:709) at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:387) at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:613) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:471) at java.lang.Thread.run(Unknown Source) Line 805 is the one shown above and line 533 just calls the method that contains it. I don't know what causes this or what I have done wrong.
-
[Solved] [1.10.2] Using Mod API Without Using Dependencies
WillR27398 replied to WillR27398's topic in Modder Support
Thanks, that clears everything up that I wanted to know, whether you fully understood what I was trying to say anyway For the most part I will just be using other mod's blocks/items so what you said will work fine, but then if there is any other classes I need then I might as well learn reflection at some point, but it most likely won't be necessary for what I want to do. Thanks again -
[Solved] [1.10.2] Entity Spawn Egg spawns Pig Only Once Built
WillR27398 replied to WillR27398's topic in Modder Support
Well I am utterly confused by the solution/problem. Basically in one of my classes I was somehow importing import scala.actors.threadpool.Arrays; instead of import java.util.Arrays; Then for some reason this didn't bother Eclipse or affect how anything worked but then caused the error in normal Minecraft. -
[Solved] [1.10.2] Entity Spawn Egg spawns Pig Only Once Built
WillR27398 replied to WillR27398's topic in Modder Support
Oh, I didn't see that. I was looking for a tick box or something, thanks for letting me know -
[Solved] [1.10.2] Entity Spawn Egg spawns Pig Only Once Built
WillR27398 replied to WillR27398's topic in Modder Support
Still absolutely no clue as to why I can use my spawn egg fine in the Eclipse/IDE environment but now when it is built and installed normally. I can't even debug it because I can't see a console when in normal Minecraft, nor does it crash or provide any logs. Any way that I can actually go about finding the problem? -
[Solved] [1.10.2] Entity Spawn Egg spawns Pig Only Once Built
WillR27398 replied to WillR27398's topic in Modder Support
Still no luck, I am going to try changing the entity ID and also a 1.9 version and report back. Edit: No luck again. I tried an older version of the mod as well which works fine so I have clearly broken something somewhere. I will just try and piece together what I have done. Is there anyway to the console in the normal game at all? -
[Solved] [1.10.2] Entity Spawn Egg spawns Pig Only Once Built
WillR27398 replied to WillR27398's topic in Modder Support
Not sure what to post but I would have thought that if it works in Eclipse but not after building it is another problem though. Registering in preinit with these two lines: EntityRegistry.registerModEntity(EntityCustom.class, "entity_Custom", Ref.entityID++, Customs.instance, 80, 1, true, 0x79553A, 0x6FAE44); EntityRegistry.addSpawn(EntityCustom.class, 5, 1, 2, EnumCreatureType.CREATURE, Biomes.BIRCH_FOREST, Biomes.BIRCH_FOREST_HILLS, Biomes.FOREST, Biomes.FOREST_HILLS, Biomes.ROOFED_FOREST, Biomes.PLAINS, Biomes.TAIGA, Biomes.SWAMPLAND, Biomes.SAVANNA); It isn't a rendering issue as the mob literally acts like a pig. I know there was a bug at one point with the spawn eggs but I just updated to the latest version of Forge to make sure so I am clueless at the moment. Not sure what code I can supply that would be of use as I can't seem to figure out the source of the issue. -
[Solved] [1.9] Sending Packets on Entity Spawn
WillR27398 replied to WillR27398's topic in Modder Support
Awesome, thanks for the explanation. I now have everything setup and working correctly using the example: http://here https://github.com/MinecraftForge/FML/issues/64 -
[Solved] [1.9] Sending Packets on Entity Spawn
WillR27398 replied to WillR27398's topic in Modder Support
As it turns out, no there were more than one in the world, so I managed to overlook that. New issue though regarding packets. If I am to send a packet during the readEntityFromNBT method, the client won't update, however if I am to send packets during the update method it will update. Could you explain the reason behind this? -
Edit: Initial issue not actually an issue as there were more than 1 entity in the world which I overlooked. New issue is this: If I am to send a packet during the readEntityFromNBT method, the client won't update, however if I am to send packets during the update method it will update. Could you explain the reason behind this? ------------------------------------------------------------------------------------------------------------------------------------------ Whenever I reload a world, the readEntityFromNBT method is called a total of 4 times for one entity. - The first time it is called, when I use compound.getInt("skin") it returns a default value of 0, which is not the one I want. - Then the second time it is called it returns 5, the actual value I want my skin field to be and the one it was set to before reloading. - Then the next to two times it is called it again returns 0, which is again not what I am looking for. So when logging this information in the console I end up with this: [iNFO] 0 [iNFO] 5 [iNFO] 0 [iNFO] 0 I cannot for the life of my figure out why this is happening and don't know what code to provide that could be of help apart from the NBT methods: @Override public void writeEntityToNBT(NBTTagCompound compound) { super.writeEntityToNBT(compound); compound.setInteger("level", level); compound.setInteger("xp", xp); compound.setDouble("health", health); compound.setDouble("damage", damage); compound.setDouble("speed", speed); compound.setInteger("type", type); compound.setInteger("skin", skin); } @Override public void readEntityFromNBT(NBTTagCompound compound) { super.readEntityFromNBT(compound); setLevel(compound.getInteger("level")); setXP(compound.getInteger("xp")); setMaximumHealth(compound.getDouble("health")); setDamage(compound.getDouble("damage")); setSpeed(compound.getDouble("speed")); setType(compound.getInteger("type")); setSkin(compound.getInteger("skin")); Log.info(compound.getInteger("skin")); } Any ideas would be much appreciated, thanks.