• 1

    posted a message on Need help learning forge code

    Most mods have a license of some sort. If you don't make any money from your mods then you can claim Fair Use Educational rights unless their license specifically forbids it. And it's not usually a problem if all you do is reference (no copy-paste) their code. Never copy-paste code.


    I don't usually go as far as looking at someone's code for help. Most of the time I can find a tutorial for some version of MC and adapt it for whatever version I'm working with.

    Posted in: Modification Development
  • 1

    posted a message on Potion effects without applying a potion?

    Minecraft's potions are pretty hard-coded. Rather than add a potion effect on equipping and removing on de-equipping, do the following each tick the item is equipped:

    - check if the player has night vision effect.

    - if not, apply a night vision effect with duration of 10 ticks (or a similarly small number other than your 159)


    That's it. This way, the potion effect will run out on its own when the item is de-equipped. If they already have night vision potion, it won't add or subtract. In that case it is just the player's fault for wasting a night vision potion when they have night vision goggles :P

    Posted in: Modification Development
  • 1

    posted a message on Consume an ItemSword and gives out another ItemSword
    Quote from Spyeedy»

    Say, i follow the first suggestion, i looked at the minecraft itemsword code. How will the sword be "on" and "off"? How does returning a new itemstack do that?


    The ItemStack you return at the end of the onItemRightClick method will always "replace" whatever was there when the player clicked. Usually it either stays the same, damages the item, reduces stack size, etc. depending what you want. So in this case you simply check which "sword" they had and replace the opposite one.
    Posted in: Modification Development
  • 1

    posted a message on I am developing a fashion environment Eclipse.

    Look at the code for vanilla Potions -- they use onItemUse or something like that. You should override that method to create an Entity that does the actual moving. Check out this tutorial, which gives the example of a throwable grenade -- you should also look at EntityArrow to see how it deals damage.

    Posted in: Modification Development
  • 1

    posted a message on [1.7.10] Making addons for mods! (Or mods in general)

    I'm trying to make my mod addon-compatible. Exactly how do I export a de-obfuscated version?


    Edit: after a bit of searching I found this thread. After editing your gradle.build file you will run gradlew deobfJar

    Posted in: Mapping and Modding Tutorials
  • 1

    posted a message on Overworld Cave Generation

    If you use Eclipse, it's easy to track down references to any class. InitMapGenEvent is fired from TerrrainGen.getModdedMapGen, which in turn is called from ChunkProviderGenerate and ChunkProviderHell.


    Only ChunkProviderGenerate passes InitMapGenEvent.EventType.CAVE to getModdedMapGen.


    The EventType enum is used in the constructor for the InitMapGenEvent.


    This is just a blurb of information that may or may not help you. Mainly it demonstrates how to track code sequence. In Eclipse, you select a class or function name, right click, and select "Open Call Hierarchy" (shortcut Ctrl+Alt+H).


    Ok, so in case you already knew about the background of that event and just want to know if it works, put a print-out statement inside the event to let you know when it is called. Also make sure it is registered on the MinecraftForge.TERRAIN_GEN_BUS somewhere from the @SubscribeEvent method that takes a FMLInitializationEvent argument.

    Posted in: Modification Development
  • 1

    posted a message on Overworld Cave Generation

    If you know anything about modding in 1.7.10, you should try doing this in 1.7.10 environment first, THEN upgrade when the logic works. I say this because for some reason most of the functions in Forge for 1.8 were not de-obfuscated, but they are in 1.7.10. Not sure why.


    Besides that, I have no other experience with what you're trying to do, sorry.

    Posted in: Modification Development
  • 1

    posted a message on How to add monster spawning at day?
    Quote from Wendzgrade»

    Thanks, and other question: can I "order" mob to go to something place (coordinates) and how?




    this.getNavigator() will let you access the mob's path and set it directly. I can't remember off the top of my head but I believe it is something like:

    this.getNavigator().setPath(worldObj.getPathToXYZ(x, y, z));


    You could also try this (copy-pasted from this thread):

    this.getNavigator().tryMoveToXYZ(this.xPosition, this.yPosition, this.zPosition, this.speed);

    Where this.xPosition, this.yPosition, this.zPosition, this.speed are defined somewhere in your class.

    Now, you can easily add this to custom mobs, but I recommend making an AI so you can add it to any mobs -- vanilla, modded, etc.
    Jabelar provides a good tutorial here.

    Happy modding!

    Posted in: Modification Development
  • 1

    posted a message on [HELP] Pulverizer don't accept my custom Lead/Ores

    Ore Dict only works if you register the right names. The point is to NOT have a unique name like "modernstuff.lead_Ore", the point is to register it with a name other mods will check for. Change this line:

    OreDictionary.registerOre("modernstuff.lead_Ore", new ItemStack(oreLead));

    Here is a list of common OreDict names-- look it up!

    Posted in: Modification Development
  • 1

    posted a message on How to add monster spawning at day?

    Vanilla monsters cannot spawn during the day through normal spawning methods. EntityZombie has a method called canSpawnHere that checks the light level and cancels if it's too bright -- it is hard-coded in.


    Alternate solution: make a class that extends EntityZombie. Then just override the canSpawnHere method to not check light. If you want to cancel burning in direct sunlight, though, you will need to copy-paste the entire class instead of inheriting it so you can change onLivingUpdate without a super call messing stuff up.

    Posted in: Modification Development
  • To post a comment, please .