-
[Solved] Prevent all villages from generating
Okay, I solved it. After changing @SubscribeEvent(priority=EventPriority.HIGHEST) to @SubscribeEvent(priority=EventPriority.LOWEST) everything works now. I don't know exactly why.
-
[Solved] Prevent all villages from generating
Ehm, but it works, because this is in the logs: [21:58:52] [server thread/INFO] [MyMod]: Stopped generation of village
-
[Solved] Prevent all villages from generating
Hi, me again. I do the following in my mod: @EventHandler public void postInit(FMLPostInitializationEvent event) { MinecraftForge.TERRAIN_GEN_BUS.register(new GenStructure()); logger.info("Registered WorldGen Events!"); } That works. Then I call in GenStructures(): public class GenStructure { @SubscribeEvent(priority=EventPriority.HIGHEST) public void onInitMapGenEvent(InitMapGenEvent event) { if(event.type.toString() == "VILLAGE") { event.newGen = new NoVillage(); MyClass.logger.info("Stopped generation of village"); } } } That works too so far, but now in NoVillage: public class NoVillage extends MapGenVillage { @Override public boolean canSpawnStructureAtCoords(int var1, int var2) { MyClass.logger.info("test"); return false; } } And that does not work. The line "test" never appears in the log and the village is generated even though I don't want it. Where is my error?
-
[1.7.10] Drop items from another mod
That was, what I was looking for! Thank you!
-
[1.7.10] Drop items from another mod
The item is registered under a name in the system. When this item exists can I pull it from there?
-
[1.7.10] Drop items from another mod
Thank you! But for that I need to include the modded class. I want to find a way around this.
-
[1.7.10] Drop items from another mod
Hi, got a problem. I need to change the drops of a modded item. I know, I can access the HarvestDropsEvent event, so I can do something like this: public void onHarvestDropsEvent(HarvestDropsEvent event) { if(event.block.toString().contains("net.minecraft.block.BlockOldLog")) { event.drops.clear(); event.drops.add(new ItemStack(Items.stick, random.nextInt(3)+1)); } } When I break wood, I get a few sticks instead of the wood logs. That works! But now I want to drop a modded item. How can I spawn it when I only got the name of it and not the actual class? Thank you!
-
[Solved] Accessing GUI elements more reliably
Thank you for your answers. I don't try to access my own button (that would be easier), I want to access the regular Minecraft GUI. The ID of the buttons are not unique so I cannot use "button.id". Nevermind, I just did it wrong! It works now, thank you!
-
[Solved] Accessing GUI elements more reliably
Updated the question because I could solve my first problem. :-)
-
[Solved] Accessing GUI elements more reliably
Hi, I have some noob questions. Problem #1 solved itself somehow!? To identify the buttons in the GUI I can do something like this: if(button.displayString.contains("Difficulty")) { button.enabled = false; } But this fails when the user has changed his language. How can I identify the buttons more reliably? Forge version is 1517 so I'm still in 1.7.10.
-
[1.7.10] Villager Trading?
I looked into the documentation but did not find an event for successful or unsuccessful villager trading. I have another mod that implements trading with its own entities with the regular merchant mechanics. My idea is to find out when a player has interact with one of the entities to trigger events that are important for the later game. It is a bit difficult to explain. I just wondered there are so many events for all sorts of interaction but none for trading. Maybe I just miss something.
-
[1.7.10] Change skeleton subtype
Nevermind, I understand it. Thank you!
-
[1.7.10] Change skeleton subtype
Just to understand the problem. Shouldn't setCurrentItemOrArmor() fail as well? BTW: It works like this ((EntitySkeleton)event.entity).setSkeletonType(1);
-
[1.7.10] Change skeleton subtype
Hm, then tell me please what's wrong with this? import net.minecraft.entity.monster.EntitySkeleton; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraftforge.event.entity.EntityJoinWorldEvent; import cpw.mods.fml.common.eventhandler.SubscribeEvent; public class WitherSkeleton { @SubscribeEvent public void onMobSpawn(EntityJoinWorldEvent event) { if (event.entity instanceof EntitySkeleton) { event.entity.setCurrentItemOrArmor(0, null); // works event.entity.setCurrentItemOrArmor(0, new ItemStack(Items.stone_sword)); // works event.entity.setSkeletonType(1); // does not work! } } } Forge 1.7.10-10.13.0.1208
-
[1.7.10] Change skeleton subtype
Depending on the latest javadocs there should be a function public void setSkeletonType(int p_82201_1_) in net.minecraft.entity.monster.EntitySkeleton. However when I try to call it it tells me cannot find symbol. Eclipse does not find it either. All necessary libs are included and the object is called correctly. Other functions work flawless. Am I missing something or did someone forget to implement it?
IPS spam blocked by CleanTalk.