Create a custom AI that tells mobs to stay away from object.
You will need to edit base mod files though.
Try to understand EntityAIAvoidEntiy and put it in your custom AI class.
After you have done that ad task to mobs entity file
Example:
This is the AI task that make mobs be able to swim
this.tasks.addTask(0, new EntityAISwimming(this));
AI class:
package net.minecraft.entity.ai;
import net.minecraft.entity.EntityLiving;
public class EntityAISwimming extends EntityAIBase
{
private EntityLiving theEntity;
public EntityAISwimming(EntityLiving par1EntityLiving)
{
this.theEntity = par1EntityLiving;
this.setMutexBits(4);
par1EntityLiving.getNavigator().setCanSwim(true);
}
/**
* Returns whether the EntityAIBase should begin execution.
*/
public boolean shouldExecute()
{
return this.theEntity.isInWater() || this.theEntity.handleLavaMovement();
}
/**
* Updates the task
*/
public void updateTask()
{
if (this.theEntity.getRNG().nextFloat() < 0.8F)
{
this.theEntity.getJumpHelper().setJumping();
}
}
}
Create a custom AI that tells mobs to stay away from object.
You will need to edit base mod files though.
Try to understand EntityAIAvoidEntiy and put it in your custom AI class.
After you have done that ad task to mobs entity file
Example:
This is the AI task that make mobs be able to swim
Create a custom AI that tells mobs to stay away from object.
You will need to edit base mod files though.
Try to understand EntityAIAvoidEntiy and put it in your custom AI class.
After you have done that ad task to mobs entity file
Example:
This is the AI task that make mobs be able to swim
AI class:
Actually, I don't think you know what I'm getting at. I don't want them to just avoid the block, I want them to be bounced back from a certain radius. Look at EE2's interdiction torch. That's what I'm trying to do.
Are there any tuts on how to make a tile entity similar to this? I'm not familiar with how to make them yet... (I know... I'm a noob...)
Not really for this, but there's a series you can take which involves advance GUI's and a lot of higher stuff related to interaction with blocks. All of which is tied together by TE's: courses.vswe.se <--- Recommended!
Also TileEntities are not that weird, think of them as classes, regular classes which are not limited by minecraft's rules of only storing 16meta etc. They can sotre unlimted amounts of information and they get updated regularly.
All they are is objects which got methods which are called when the player interacts with them and which gets updated often via it's update call.
That explanation of TE's was what made me understand them as something more than some fancy Minecraft thing, they are quite simply just basic java stuff If you know Java then they are rather simple when you don't think of them as scary magical minecraft stuff.
Not really for this, but there's a series you can take which involves advance GUI's and a lot of higher stuff related to interaction with blocks. All of which is tied together by TE's: courses.vswe.se <--- Recommended!
Also TileEntities are not that weird, think of them as classes, regular classes which are not limited by minecraft's rules of only storing 16meta etc. They can sotre unlimted amounts of information and they get updated regularly.
All they are is objects which got methods which are called when the player interacts with them and which gets updated often via it's update call.
That explanation of TE's was what made me understand them as something more than some fancy Minecraft thing, they are quite simply just basic java stuff If you know Java then they are rather simple when you don't think of them as scary magical minecraft stuff.
If you are that unfamiliar with TE's I would STRONGLY suggest you take the mentioned courses.
Because if you follow them you're knowledge will be more complete and less full of holes.
Vswe courses are really courses and not just simple tutorials, and if you follow them to completion you will learn to make pretty advance stuff, which is beyond what simple tutorials ever show you :)If a block overrides two methods:
createTileEntity() // returns new YourTileEntityHere;
and
hasTileEntity() // returns true;
It will be obfuscated and as the other is NOT an expert in java this won't help him much.
Besides even an java expert would use a lot of time on figuring out which class is which and what the real names of functions are.
All classes are named a.class, b.class etc. and all functions are names func_2321_ax etc.
It wouldn't be helpful
Restarting this topic because I looked into the EE2 code and realized he had it all in his block class. I see what it's doing, but I'm not exactly sure how to do it with my code in 1.5.2. This is what it looks like:
private void PushEntities(nn eentity, int i, int j, int k) {
if (!(eentity instanceof yw)) {
nn pushentity = eentity;
double d = i - pushentity.o;
double d1 = j - pushentity.p;
double d2 = k - pushentity.q;
double d4 = d * d + d1 * d1 + d2 * d2;
d4 *= d4;
if (d4 <= Math.pow(6.0D, 4.0D)) {
double d5 = -(d * 0.01999999955296516D / d4) * Math.pow(6.0D, 3.0D);
double d6 = -(d1 * 0.01999999955296516D / d4) * Math.pow(6.0D, 3.0D);
double d7 = -(d2 * 0.01999999955296516D / d4) * Math.pow(6.0D, 3.0D);
if (d5 > 0.0D) {
d5 = 0.22D;
}
else if (d5 < 0.0D) {
d5 = -0.22D;
}
if (d6 > 0.2D) {
d6 = 0.12D;
}
else if (d6 < -0.1D) {
d6 = 0.12D;
}
if (d7 > 0.0D) {
d7 = 0.22D;
}
else if (d7 < 0.0D) {
d7 = -0.22D;
}
pushentity.r += d5;
pushentity.s += d6;
pushentity.t += d7;
}
}
}
Please do not take this wrong, as I do not intend to be rude at all. Please take the suggestions from Mazetar and go to those courses, they are free and will help you immensely in your coding and modding. It just seems like most of your mod has been written by the community (and I hope you are keeping track to give proper credit). When I first started modding, I had only two basic courses in java, and a c+ class in college. I did not pan out well in those classes, and when I started modding I viewed some online courses on youtube, and some of the stuff the Mazetar links for everyone. I still dont know enough to do half of the things I want to do and sadly have to search for solutions. I do ask for help from time to time....just ask coolAlias....
Basically, if you dont want to view the courses from Mazetar, I would find some basic tutorials and start back at the beginning til you know and understand blocks, items, and so on. Yes this will take you off your project, but when you get back to it, it will have paid off....it just doesnt seem like you are willing to try to understand what you are doing. The code you posted above does seem a bit confusing, but if you look at the rails in 1.6.2 that sort of does this with mobs, or look at how a boat is placed in the water, or how particles are functioning, they all use this basic formula to some degree. Its for getting the coordinates, and rotation of objects and entities (may be wrong in explanation on this part) and the ability to place the object or entity. You really should do yourself the favor of viewing the material that is provided to you.....Mazetars links, some basic java on youtube and the source code in minecraft (they are all free). Also take the time to read through some pieces of the code in minecraft source, it will help you understand how to link tiles to blocks too...
Please do not take this wrong, as I do not intend to be rude at all. Please take the suggestions from Mazetar and go to those courses, they are free and will help you immensely in your coding and modding. It just seems like most of your mod has been written by the community (and I hope you are keeping track to give proper credit). When I first started modding, I had only two basic courses in java, and a c+ class in college. I did not pan out well in those classes, and when I started modding I viewed some online courses on youtube, and some of the stuff the Mazetar links for everyone. I still dont know enough to do half of the things I want to do and sadly have to search for solutions. I do ask for help from time to time....just ask coolAlias....
Basically, if you dont want to view the courses from Mazetar, I would find some basic tutorials and start back at the beginning til you know and understand blocks, items, and so on. Yes this will take you off your project, but when you get back to it, it will have paid off....it just doesnt seem like you are willing to try to understand what you are doing. The code you posted above does seem a bit confusing, but if you look at the rails in 1.6.2 that sort of does this with mobs, or look at how a boat is placed in the water, or how particles are functioning, they all use this basic formula to some degree. Its for getting the coordinates, and rotation of objects and entities (may be wrong in explanation on this part) and the ability to place the object or entity. You really should do yourself the favor of viewing the material that is provided to you.....Mazetars links, some basic java on youtube and the source code in minecraft (they are all free). Also take the time to read through some pieces of the code in minecraft source, it will help you understand how to link tiles to blocks too...
I know how to make blocks and items. My coding knowledge goes down to making an advanced mob. All I'm asking from you guys is a direction to go in, because that's the way I learn. Once you give me an idea of what I can do, I go out and try to do it. I like figuring out how to do things along the way instead of taking some boring class where a guy just lectures you the whole time. I find this way of learning java very effective actually, because with your help I've gone a long way. I've made several advanced mobs, I've made advanced armors, and I've even made advanced weapons that shoot projectiles and such. If you see what I'm trying to get at, then please help me learn more. What Mazetar gave me was a very complicated way of doing it, when I've figured out that Pahimar just had one method in his block code that repels mobs. But, I understand if you don't want to help me anymore, because I am getting quite annoying. Thanks again,
Repxile
You should really learn to crawl before you can run mate.
This is like the N'th example of you wanting help with stuff but really having a need to learn the basics.
Come'on mate if you don't have the time or will to learn anything related to modding, then you don't have the time or will to create mods.
You should really learn to crawl before you can run mate.
This is like the N'th example of you wanting help with stuff but really having a need to learn the basics.
Come'on mate if you don't have the time or will to learn anything related to modding, then you don't have the time or will to create mods.
No offense, but I need help, not suggestions. For the last time, I'm not going to take those courses. Please help.
Hope this helps!
Cheers,
SuperBrea
You will need to edit base mod files though.
Try to understand EntityAIAvoidEntiy and put it in your custom AI class.
After you have done that ad task to mobs entity file
Example:
This is the AI task that make mobs be able to swim
AI class:
onUpdate do check for all entities within range.
foreach entity inrange
make entity go somewhere else.
Not really for this, but there's a series you can take which involves advance GUI's and a lot of higher stuff related to interaction with blocks. All of which is tied together by TE's: courses.vswe.se <--- Recommended!
Also TileEntities are not that weird, think of them as classes, regular classes which are not limited by minecraft's rules of only storing 16meta etc. They can sotre unlimted amounts of information and they get updated regularly.
All they are is objects which got methods which are called when the player interacts with them and which gets updated often via it's update call.
That explanation of TE's was what made me understand them as something more than some fancy Minecraft thing, they are quite simply just basic java stuff If you know Java then they are rather simple when you don't think of them as scary magical minecraft stuff.
If you are that unfamiliar with TE's I would STRONGLY suggest you take the mentioned courses.
Because if you follow them you're knowledge will be more complete and less full of holes.
Vswe courses are really courses and not just simple tutorials, and if you follow them to completion you will learn to make pretty advance stuff, which is beyond what simple tutorials ever show you :)If a block overrides two methods:
createTileEntity() // returns new YourTileEntityHere;
and
hasTileEntity() // returns true;
then it will have that specified tileEntity
It will be obfuscated and as the other is NOT an expert in java this won't help him much.
Besides even an java expert would use a lot of time on figuring out which class is which and what the real names of functions are.
All classes are named a.class, b.class etc. and all functions are names func_2321_ax etc.
It wouldn't be helpful
Please do not take this wrong, as I do not intend to be rude at all. Please take the suggestions from Mazetar and go to those courses, they are free and will help you immensely in your coding and modding. It just seems like most of your mod has been written by the community (and I hope you are keeping track to give proper credit). When I first started modding, I had only two basic courses in java, and a c+ class in college. I did not pan out well in those classes, and when I started modding I viewed some online courses on youtube, and some of the stuff the Mazetar links for everyone. I still dont know enough to do half of the things I want to do and sadly have to search for solutions. I do ask for help from time to time....just ask coolAlias....
Basically, if you dont want to view the courses from Mazetar, I would find some basic tutorials and start back at the beginning til you know and understand blocks, items, and so on. Yes this will take you off your project, but when you get back to it, it will have paid off....it just doesnt seem like you are willing to try to understand what you are doing. The code you posted above does seem a bit confusing, but if you look at the rails in 1.6.2 that sort of does this with mobs, or look at how a boat is placed in the water, or how particles are functioning, they all use this basic formula to some degree. Its for getting the coordinates, and rotation of objects and entities (may be wrong in explanation on this part) and the ability to place the object or entity. You really should do yourself the favor of viewing the material that is provided to you.....Mazetars links, some basic java on youtube and the source code in minecraft (they are all free). Also take the time to read through some pieces of the code in minecraft source, it will help you understand how to link tiles to blocks too...
Find out how I generate....coolAlias...world structure generation and rotation tool...
Repxile
This is like the N'th example of you wanting help with stuff but really having a need to learn the basics.
Come'on mate if you don't have the time or will to learn anything related to modding, then you don't have the time or will to create mods.