Jump to content

TheMineshafter

Members
  • Posts

    20
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

TheMineshafter's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Hey guys, I'm trying to experiment with the onBlockActivated function. I'm trying to create a block that will give the player an item when clocked with a bone. The function works when I don't check the player's held item for a bone. However, it refuses to spawn the item when I use an if statement to check. I'm not sure what's wrong, but here's my code: http://pastebin.com/VNS0sAxy
  2. I posted the class files affecting the issue though. If you would like to see my entire code, however, it's right here: http://www.mediafire.com/download/eld11cqvb8cr7u1/NightmareCreatures_src.zip
  3. Ahh, I see... That would prevent me from making a mistake with the ids. Thanks for the tip! However, I double checked to make sure that the ids matched up correctly, and it still didn't work. The item spawns were all messed up. I'm really not sure what's causing the problem...
  4. So a String id is like any other id except it's in the form of a string, right? How would this work differently than an integer id? Is it because string is a class data type?
  5. So then how would I go about doing that? I searched for tutorials but none of them were very helpful. The code would come out as confusing and messy. However, I realized that I could just use normal items to spawn entities using the onItemClick function. This turned out to be much simpler for me, but now there is an issue with the ids. When i stopped using global entity ids, the eggs began spawning the wrong mobs.
  6. I see.. so the only way to really fix this is to update? How can I fix this in 1.7.10 then? I know that some modders use their own custom spawn eggs to spawn mobs, which is what I was trying to do.
  7. We already told you how to do it without custom spawn eggs. OP is on 1.7.10 ... (seriously, update). Did you seriously create a separate class for every. single. SpawnEgg? Seriously? You need one class and one Item. Store the type of Mob to spawn (it's String (!) ID) in the ItemStacks NBT data instead of taking up a gazillion Item IDs. Also (again!): Do not use LanguageRegistry. Use a .lang file. You don't need to make the Entity IDs configurable. It serves no purpose and just confuses users. About all those addSpawn calls... You do know that addSpawn has a varargs parameter, right? Use it! (Don't know what varargs means? Learn java.) First of all, there is no version of registerModEntity that takes the two color arguments for spawn eggs. I tried looking through the forge library and I couldn't find it. Second, these classes are not permanent, since I'm still figuring out how to use only one class (I'm making normal items and using the onItemUse method to spawn the mobs. It's the simplest way I found). Third, I am going to create the lang file, but I'm using the language registry method until I fix the spawn egg problem. One problem at a time. As for NBT and varargs, I am learning how to use Java as I'm working on this mod. I know basic to intermediate java, but there are also things in the language that I'm not familiar with. Could you guys post an example of the registerModEntity that takes the color arguments? That would really help.
  8. Hey guys, I hate to open another topic after somebody just helped me, but I ran across another nasty problem. In my previous post (link: http://www.minecraftforge.net/forum/index.php?topic=35356.0), somebody told me that I shouldn't use global ids, since they are not compatible with mod packs due to their limitation. I was told that I should use the EntityRegistry only, and make my own spawn eggs. I was able to do this, and the eggs work perfectly fine. However, when I get rid of global ids, the eggs no longer spawn the mob. Here is my code: Main Class: http://pastebin.com/Pf9SWeK5 Spawn Egg Registry: http://pastebin.com/CzjmNUKx Mob Registry (Drider): http://pastebin.com/eLN92yjb Config Class: http://pastebin.com/jUqGQfg7
  9. Ahh, ok. I think I understand what I need to do now. Thank you!
  10. So then how would I set IDs without using global? I tried to set them using the config class but it doesn't work.
  11. *mentally slaps forehead* I can't believe that I didn't realize that. Thank you. I'm not sure what the other changes will do though, since the system I'm using has been working fine up to this point. Will they make the code run faster?
  12. Hey guys, I'm currently learning how to create a config file. While I was successfully able to generate the file, it doesn't change anything. The config is meant to allow players to change the spawn rates of certain mobs. However, the inputed config values don't change anything. I really don't know what to do. ._. Here's my code: Main class: http://pastebin.com/fTkTdaPX Config: http://pastebin.com/c2JrKTdZ One mob register class as an example: http://pastebin.com/ucnTduT8
  13. Hey guys, I keep getting this error whenever I do anything with gradle. It started when I tried to build a mod and the build failed. Now, I'm trying to build a new workspace and I keep getting the same exact ever. I'm not sure what to do. This is what I keep getting: FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring root project 'NightmareCreatures'. > Could not resolve all dependencies for configuration ':classpath'. > Could not resolve net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT. Required by: :NightmareCreatures:unspecified > Unable to load Maven meta-data from http://files.minecraftforge.net/maven/net/minecraftforge/gradle/ForgeGradle/1.2-SNAPSHOT/maven-metadata.xml. > Could not GET 'http://files.minecraftforge.net/maven/net/minecraftforge/gradle/ForgeGradle/1.2-SNAPSHOT/maven-metadata.xml'. Received status code 403 from server: Forbidden * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED
  14. Actually, I found the issue: It was a problem with the way I wrote my build file. I managed to compile it now> Thank you for your help.
×
×
  • Create New...

Important Information

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