-
Posts
82 -
Joined
-
Last visited
Everything posted by TheAwesomeGem
-
[1.10.2] Custom Entity Problem(Solved)
TheAwesomeGem replied to TheAwesomeGem's topic in Modder Support
I managed to solve it by myself. It seems to be a bug with Minecraft itself. -
[1.10.2] Custom Entity Problem(Solved)
TheAwesomeGem replied to TheAwesomeGem's topic in Modder Support
I even changed step height but that didn't fix it either. Seems like riding entities are broken. -
So I have a custom entity that extends from the EntityMob class and I made it ride a horse. But for some reason, it doesn't want to step down a block. But it can set-up on a block. What am I missing here?
-
[1.10]How to turn this data container into configuration?
TheAwesomeGem replied to TheAwesomeGem's topic in Modder Support
Well, managed to solve it by myself using string delimiter. Is there any string length limit for a getStringArray? -
This is the data container I have: public static Map<Integer, List<Pair<String, Integer>>> warriorEquipmentMainHandMap = new HashMap<Integer, List<Pair<String, Integer>>>() {{ put(1, new ArrayList<Pair<String, Integer>>() {{ add(new Pair<>("wooden_axe", 70)); add(new Pair<>("stone_axe", 30)); }}); put(2, new ArrayList<Pair<String, Integer>>() {{ add(new Pair<>("wooden_axe", 20)); add(new Pair<>("stone_axe", 70)); add(new Pair<>("iron_axe", 10)); }}); put(3, new ArrayList<Pair<String, Integer>>() {{ add(new Pair<>("stone_axe", 70)); add(new Pair<>("iron_axe", 30)); }}); }}; Basically I want to turn that into this on the config: warriorequipmentmainhand{ 1{ "wooden_axe":70, "stone_axe":30 } 2{ "wooden_axe":20, "stone_axe":70, "iron_axe":10 } 3{ "stone_axe":70, "iron_axe":30 } } How would I go about doing that since I don't see a list of keyvalpair on configuration?
-
I ended up doing this. Not sure if it's more efficient but it's less code to write. @SubscribeEvent public void onLivingSpawnCheck(LivingSpawnEvent.CheckSpawn e) { if(e.getWorld().isRemote) return; if(!(e.getEntityLiving() instanceof EntityUndead)) return; int range = 64; float minX = e.getX() - range; float minY = e.getY() - range; float minZ = e.getZ() - range; float maxX = e.getX() + range; float maxY = e.getY() + range; float maxZ = e.getZ() + range; List<EntityUndead> entityUndeadList = e.getWorld().getEntitiesWithinAABB(EntityUndead.class, new AxisAlignedBB(minX, minY, minZ, maxX, maxY, maxZ)); if(entityUndeadList.size() > 5) e.setResult(Result.DENY); }
-
This is what I have so far @SubscribeEvent public void onPreEntitySpawn(PotentialSpawns e) { if(e.getWorld().isRemote) return; List<SpawnListEntry> spawnListEntryList = e.getList(); Iterator<SpawnListEntry> spawnListEntryIterator = spawnListEntryList.listIterator(); while(spawnListEntryIterator.hasNext()) { SpawnListEntry spawnListEntry = spawnListEntryIterator.next(); if(spawnListEntry.entityClass.equals(EntityUndead.class)) { Chunk chunk = e.getWorld().getChunkFromBlockCoords(e.getPos()); int undeadCount = 0; ClassInheritanceMultiMap<Entity>[] entityInheirtanceMapList = chunk.getEntityLists(); for(ClassInheritanceMultiMap<Entity> entityInheritanceMap : entityInheirtanceMapList) { Iterable<EntityUndead> entityList = entityInheritanceMap.getByClass(EntityUndead.class); for (EntityUndead ignored : entityList) undeadCount++; } System.out.println(e.getPos().toString() + " Undead Count: " + undeadCount); } } } The reason I need this is to control the number of my own custom entity on a chunk. So what I am trying to achieve here so removing PotentialSpawn of my custom creature on a chunk that has surpassed the max number of my custom entity per chunk. However, it doesn't look clean at all and is pretty inefficient. Any other ways to achieve the same thing?
-
How to add a newline after the namtag's name?
TheAwesomeGem replied to TheAwesomeGem's topic in Modder Support
Where does that rendering take place at? I can see the vanilla code and replicate it. -
I have a custom entity and I want to add an extra information under the player nametag. How would I go about doing that?
-
Trying to understand how Forge works
TheAwesomeGem replied to TheAwesomeGem's topic in Modder Support
Interesting. How do you fix an issue like that? Use Minecraft.getMinecraft() only on the client proxy? -
Trying to understand how Forge works
TheAwesomeGem replied to TheAwesomeGem's topic in Modder Support
So on the code above, it wouldn't crash the server because of the isRemote check. But I see it as a good example when to use isRemote. -
Trying to understand how Forge works
TheAwesomeGem replied to TheAwesomeGem's topic in Modder Support
Aaah I see. Thanks for the warning. On that case, we will have to use @SideOnly BTW world.isRemote is always false on dedicated server isn't it? -
Trying to understand how Forge works
TheAwesomeGem replied to TheAwesomeGem's topic in Modder Support
What do you mean? Can you give me an example. -
Trying to understand how Forge works
TheAwesomeGem replied to TheAwesomeGem's topic in Modder Support
Final question, is it bad to almost do the world.isRemote check just to make sure whatever logic is only being applied to the server? -
Trying to understand how Forge works
TheAwesomeGem replied to TheAwesomeGem's topic in Modder Support
Is there like documentation on which events/class gets run where? Like the item/block/entity class. Also, is capabilities clientside or serverside? -
Does all the classes in my mod load for both the server and client?(excluding the client proxy, renderers and models are only loaded in the client) I know I can use world.isRemote to choose which side I want to work with. Does all the events are called for both client and server? Does the Item, Block, Entity, AI class gets loaded and called for both the client and server? How do you know which class gets called for the server, client or both?(Just so I know when to use world.isRemote so I don't get desync)
-
How to disable the end in forge?
TheAwesomeGem replied to TheAwesomeGem's topic in General Discussion
That make sense. Is there anyway to disable entity updates on the end though? I remember disabling the end with cauldron and it worked fine. However, I do not wish to use that. -
How to disable the end in forge?
TheAwesomeGem replied to TheAwesomeGem's topic in General Discussion
I am glad I didn't miss a config for that. Do you know what function I can use on my mod to disable the whole end dimension(no chunk updates or entity updates) including the region files? -
I can't find a way to disable the end. How would I go about removing that dim?
-
[1.7.10]How to make zombies faster on water?
TheAwesomeGem replied to TheAwesomeGem's topic in Modder Support
Doesn't seem like their is a way to increase the zombie's speed in water since movement speed is based on the land. However, maybe altering velocity would work. But I don't know if it's a way to go. -
How do I increase the movement speed of zombies when they are on the water? I tried this but it did not work. @SubscribeEvent public void onLivingEntityUpdate(LivingEvent.LivingUpdateEvent e) { Entity entity = e.entity; if(e.entity instanceof EntityLiving) { if(e.entity instanceof EntityZombie) { EntityZombie zombie = (EntityZombie) entity; if(zombie.isInWater()) { if(zombie.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue() != 2.0) { zombie.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(2.0); } } else { if(zombie.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue() != 0.23) { zombie.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.23); } } } } }
-
[1.7.10] Changing textures in real-time
TheAwesomeGem replied to TheAwesomeGem's topic in Modder Support
Thanks guys! I will try to figure out how to work it out, now that I know how the system works. -
Can you possible change textures in real-time? I have mine changing it on interact, but it doesn't change the texture. What's a good method to change the textures in real-time?
-
[1.7.10] Proper way to modify blocks when populating chunks
TheAwesomeGem replied to TheAwesomeGem's topic in Modder Support
Is there actually any way to do it? -
[1.7.10] Proper way to modify blocks when populating chunks
TheAwesomeGem replied to TheAwesomeGem's topic in Modder Support
Really frustrating that I cannot do this without getting any problems.