Jump to content

DrD

Members
  • Posts

    30
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

DrD's Achievements

Tree Puncher

Tree Puncher (2/8)

1

Reputation

  1. Okay, I solved it. After changing @SubscribeEvent(priority=EventPriority.HIGHEST) to @SubscribeEvent(priority=EventPriority.LOWEST) everything works now. I don't know exactly why.
  2. Ehm, but it works, because this is in the logs: [21:58:52] [server thread/INFO] [MyMod]: Stopped generation of village
  3. 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?
  4. That was, what I was looking for! Thank you!
  5. The item is registered under a name in the system. When this item exists can I pull it from there?
  6. Thank you! But for that I need to include the modded class. I want to find a way around this.
  7. 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!
  8. 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!
  9. Updated the question because I could solve my first problem. :-)
  10. 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.
  11. 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.
  12. Nevermind, I understand it. Thank you!
  13. Just to understand the problem. Shouldn't setCurrentItemOrArmor() fail as well? BTW: It works like this ((EntitySkeleton)event.entity).setSkeletonType(1);
  14. 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
  15. 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?
×
×
  • Create New...

Important Information

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