Jump to content

MSandro

Members
  • Posts

    19
  • Joined

  • Last visited

MSandro's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Which new system? Where can I see the mapping builds? I started porting to 1.16.2 today, where 20200514-1.16 is still used. It is a bit frustrating not to know where to get new mappings.
  2. Hi, I try to deny tree growing in specified dimensions. I've found SaplingGrowTreeEvent but I can't get it to work. ... @EventHandler public void init(FMLInitializationEvent event) { MinecraftForge.TERRAIN_GEN_BUS.register(new TerrainEvents()); MinecraftForge.EVENT_BUS.register(new TerrainEvents()); ... } ... ... public class TerrainEvents { @SubscribeEvent public static void onSapling(SaplingGrowTreeEvent event) { System.out.println("TreeGrowEvent Triggered"); for (String curdim : ConfigManager.DenyInDims) { String[] cs = curdim.split(";"); if (event.getWorld().provider.getDimension() == Integer.valueOf(cs[0])) { if (cs[1].toCharArray()[0] == 't') { event.setResult(Event.Result.DENY); } } } } } Forge Version: forge-1.12.2-14.23.5.2768 What is going wrong? It seems like the event never fires. Thank you for your help.
  3. Thank you, I know about this forge documentation, but currently I try to folow this tutorial: https://www.planetminecraft.com/blog/forge-tutorial-capability-system/ It seems to be more understandable than the forge documentation.
  4. Hi, I tried to save some informations in the player.dat files, but I don't understand how. I understand how to do this in MC 1.8 and earlier but since 1.9 this is changed . How can I save this in as player-data like the following: Thank you very much and heave a nice day!
  5. Thank you very much. Yes I know about the item-comparison but later I want to use a config file to check the items, so I must use strings because it is the simpliest way to interact with the config. I will take a look to your tutorial, later.
  6. Hi, and heave a nice day! I want to make a mod with many abilities. One part of it is to handle tasks or checkpoints to trigger "ages". So I want to block some crafting recipes until a pleyer reach the needed "level". Remove a recipe server-wide is easy but I don't know how to remove recipes only for players corectly. I tried a very primitiv work-around but it has several problems: @SubscribeEvent public void onCraft(ItemCraftedEvent event) { if (event.crafting.getItem().getRegistryName().toString().contains("minecraft:wooden_sword")) { event.player.inventory.clearMatchingItems(Item.getByNameOrId("minecraft:wooden_sword"), -1, 1, null); } } @SubscribeEvent public void pickUp(EntityItemPickupEvent event) { if (event.getEntity() instanceof EntityPlayer) { if (event.getItem().getEntityItem().getItem().getRegistryName().toString().contains("minecraft:wooden_sword")) { event.setCanceled(true); } } } The first part is removing the output from the players inventory. But the player is loosing the ingridients. The second part destroying the items on pickup, because the player can pres "Q" in the workbench to drop the item. Is it posible to prevent the player from taking the result out of the workbench? The ingridients should stay in the bench. I tried to cancel the event, but then the client crashes. Also is there a event for "event.getEntityPlayer().inventory.inventoryChanged"? I want to drop the item when a player gets a forbidden item. Thank you very much for your help.
  7. Very strange, I tried to put my code for the entities into a separate method. Now it works perfectly
  8. Trank you very much yes I try, but I am very new in Java
  9. https://bitbucket.org/MSandro1998/ms-utilities/src Here is the link to my bitbucket repo.
  10. sorry but I never used Git bevore, but I will check it out soon. You can find a .zip in the atachement of this post. MS Utilities.zip
  11. Does not work too... What am I doing wrong? shelter.java: It only works when I comment out the top block, but I do not understand why!! Edit: No matter which block is commented out, but it must be one. shelter.java
  12. thank you very much for your help, but unfortunately that did not work either.
  13. Thank you, but I already tried that. Don't work I've noticed that something is wrong with my "shelter.jar". if I change: "Entity LeftEntity = EntityList.createEntityByName(ConfigManager.ShelterLeftEntity, world);" to: "EntityLiving LeftEntity = (EntityLiving) EntityList.createEntityByName(ConfigManager.ShelterLeftEntity, world);" The log says: shelter.java
×
×
  • Create New...

Important Information

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