Posted May 29, 201411 yr This will be my first mod, I have no experience at all with java or forge. I'm trying to teach myself some stuff trough tutorials on-line. But i can't seem to find the specific information i need. I feel it shouldn't be such a difficult thing to achieve, altough it probably is. Any help would be greatly appreciated
May 29, 201411 yr Check LivingSpawnEvent class. You'll need to work with Forge event bus to handle this event. Look for Forge event tutorials. One googled: http://minecraftforgetutorials.weebly.com/event-introduction.html
May 29, 201411 yr If you have no experience with Java, go on youtube, watch several tutorial and program in java for a weekend before starting at a minimum. If you have no programming experience at all, take longer. Long time Bukkit & Forge Programmer Happy to try and help
May 29, 201411 yr Author Thanks, both of you. I realize i should follow a few tutorials first before starting with this, because right now i don't even know how to start I'm not going to give up though i'll see this trough until i have something i'm happy with. I'll explain a little better what my goal is. I'd like to make a mod in which for example a custom mob starts spawning from x=500 to x=1000 and then have another custom mob spawn from x=1000 to x=1500 and so on. The idea is that the further you are away from spawn the more difficult the mobs will be to kill.
May 29, 201411 yr But spawn isn't always on x=0 and z=0. It is always randomized. Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support. 1.12 -> 1.13 primer by williewillus. 1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support. http://www.howoldisminecraft1710.today/
May 30, 201411 yr Author yeah sorry, i meant spawnpoint. I thought they were the same, but that probabbly will make it more difficult.
May 30, 201411 yr yeah sorry, i meant spawnpoint. I thought they were the same, but that probabbly will make it more difficult. To control where the mob spawns, override getCanSpawnHere and return wheter it should spawn (true) or not (false) To check a radius, do this: Math.abs(spawnX - entityX) >= 500 && Math.abs(spawnZ - entityZ) >= 500 will check if it's not in a 500x500 squared perimeter around the spawn Math.sqrt(Math.pow(spawnX - entityX, 2) >= 500 && Math.pow(spawnZ - entityZ, 2)) >= 500 will check if it's not in a circle perimeter with radius 500 around the spawn (I think the math is right, don't count me on that, though) Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! | mah twitter This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.
May 30, 201411 yr Rather than invoking library code to compute limits, just use: boolean farEnough(int entityX, int entityY, int spawnX, int spawnY) { int dx = spawnX - entityX, dy = spawnY - entityY; return (dx*dx + dy*dy > 500*500); } -S- (if I helped, please click Thank and applaud) http://6upnqa.dm2301.livefilestore.com/y2mtf-vG7Tqq1TiiVpIm53KWj7294NDPoHfSHHb4PzZiMAUfRCfK0UY0MwOu7Q3zTBNVTKqWjr2-xgBfFRpQT5p-QivtvknPpoABMNUw9br9WuZcBFkjePhnAbW500gVm-P/sequiturian.png[/img]
May 31, 201411 yr Rather than invoking library code to compute limits, just use: boolean farEnough(int entityX, int entityY, int spawnX, int spawnY) { int dx = spawnX - entityX, dy = spawnY - entityY; return (dx*dx + dy*dy > 500*500); } That works, too and is less resource-intensive. Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! | mah twitter This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.
May 31, 201411 yr Author Thanks guys this will definitely get the ball rolling. I'm going to need to learn some java for sure but this made things a million times easier already.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.