No offense, but I need help, not suggestions. For the last time, I'm not going to take those courses. Please help.
Those suggestions are help...when you say things like that it really makes people not want to help, mostly because we feel like we are writing the mod for you. We are merely suggesting that you may need to understand more about java before trying to mod. From the looks of things you have been given at least 2 possible answers that will work.
Those suggestions are help...when you say things like that it really makes people not want to help, mostly because we feel like we are writing the mod for you. We are merely suggesting that you may need to understand more about java before trying to mod. From the looks of things you have been given at least 2 possible answers that will work.
Obviously you haven't taken the time to read the previous posts, because I state that I took a look at Pahimar's code, and I deciphered that he didn't bother to make a tile entity at all. That's why I'm still looking. Pahimar had 1 single method in his block class, and that's what I'm looking for. Also, I feel that a lot of people would agree, I think that I would learn much better on my own from my mistakes then listening to lectures that I'll forget about.
Edit: Nvm this is EE2, which the src code is unreadable and closed src. so I can't tell you anything about how it works or how he did his stuff.
I gave you a solution which works for me, and which you quoted saying this was what you where looking for.
It's A solution, there are always several ways to do things.
I also see that another solution has been given to your problem.
So I would assume this problem to be solved by now? -_-'
If you want it to be a smooth "bump away", find whether the entity is in range, find it's velocity (it should be in a vector), and set it's velocity to the normalized, negated old velocity.
Rollback Post to RevisionRollBack
java.lang.NullPointerException - Signature cannot be null!
If you want it to be a smooth "bump away", find whether the entity is in range, find it's velocity (it should be in a vector), and set it's velocity to the normalized, negated old velocity.
Now that's a good way to do it.
The answers in this thread are really nice and the sum of these posts explain the processes you can create in order to accomplish a mob repelling block.
Now that's a good way to do it.
The answers in this thread are really nice and the sum of these posts explain the processes you can create in order to accomplish a mob repelling block.
I would say everything is solved neatly here now
This is of course, provided he is not just waiting for someone to just write the code for him.
If you want it to be a smooth "bump away", find whether the entity is in range, find it's velocity (it should be in a vector), and set it's velocity to the normalized, negated old velocity.
By the way, haven't ever touched vectors or velocity, so I would appreciate it if you could give me a boost. I'm not the best with entities(AKA I'm a huge scrub lord). Thanks!
A vector is basically an object that has direction and magnitude. To get the direction of a vector, you normalize it. To normalize a vector, you must divide each part of the vector by the entire vector's magnitude, which is found using this formula:
Notice how there are commas separating the x, y, and z coordinates. It is mighty similar to a coordinate plane when you are writing it out.
Next, you should make sure you normalized the vector correctly. To do that, find its magnitude using the formula above. The magnitude should be very close to 1.
Rollback Post to RevisionRollBack
java.lang.NullPointerException - Signature cannot be null!
A vector is basically an object that has direction and magnitude. To get the direction of a vector, you normalize it. To normalize a vector, you must divide each part of the vector by the entire vector's magnitude, which is found using this formula:
Notice how there are commas separating the x, y, and z coordinates. It is mighty similar to a coordinate plane when you are writing it out.
Next, you should make sure you normalized the vector correctly. To do that, find its magnitude using the formula above. The magnitude should be very close to 1.
Very nice explanation! Minecraft, however, provides a much simpler utility class: Vec3. Create a Vec3 object and then use the normalize() method - all the math done for you
Very nice explanation! Minecraft, however, provides a much simpler utility class: Vec3. Create a Vec3 object and then use the normalize() method - all the math done for you
Yeah... I forgot about the Minecraft class. Oh well.
Rollback Post to RevisionRollBack
java.lang.NullPointerException - Signature cannot be null!
Hey sorry to bring this topic back up. I know I went off the radar for a while, and I just got back to modding. I still haven't figured this out. Here's my code right now:
Why are you creating variables with names such as "d0" and "d1"? It makes your code hard to read.
Also since you only ever use those variables once it's ineffective (wasted cycles) to declare 6 variable only to be used once on the very next line. Especially considering that this happens once for every item in the list.
You probably would want to fix that clog
Why are you creating variables with names such as "d0" and "d1"? It makes your code hard to read.
Also since you only ever use those variables once it's ineffective (wasted cycles) to declare 6 variable only to be used once on the very next line. Especially considering that this happens once for every item in the list.
You probably would want to fix that clog
Secondly what is the purpose of the variable "f"?
Sorry about the messy code. The variable "f" is a variable I thought that I might need, but I ended up not needing it. Anyways, my problem is that this cycle literally does nothing. I know I'm probably missing a ton of code but this was my best crack at the explanation JanitorialMilk gave me.
EDIT: If you have an explanation a noob like me can read, please post it.
that's code from one of my modding experiments (making a telekinetic effect). If you can obtain an angle from your torch to the entity (I recommend finding an angle from their positions) , and put it in place of "player.rotationYawHead", it should simulate an actual blowback rather than just sort of reset their position.
that's code from one of my modding experiments (making a telekinetic effect). If you can obtain an angle from your torch to the entity (I recommend finding an angle from their positions) , and put it in place of "player.rotationYawHead", it should simulate an actual blowback rather than just sort of reset their position.
I just tested out your code to see how strong it was. I'm looking for a smooth bump away. If you go back and look at EE2's interdiction torch, you can see what I'm talking about. And about making a tile entity, I think I'm just going to stick to JanitorialMilk's method and use vectors and velocities, as it means that I don't have to make a whole new class.
I kind of thought you would test how the code works on your own... if you want a small push, just change the 1 to a much lesser value and the two "* 4"s to a much lesser value.
Those suggestions are help...when you say things like that it really makes people not want to help, mostly because we feel like we are writing the mod for you. We are merely suggesting that you may need to understand more about java before trying to mod. From the looks of things you have been given at least 2 possible answers that will work.
Find out how I generate....coolAlias...world structure generation and rotation tool...
Good then go make your own mistakes and solve them on your own then?
And here's what Pahimar did:https://github.com/p...-3/tree/master/
Edit: Nvm this is EE2, which the src code is unreadable and closed src. so I can't tell you anything about how it works or how he did his stuff.
I gave you a solution which works for me, and which you quoted saying this was what you where looking for.
It's A solution, there are always several ways to do things.
I also see that another solution has been given to your problem.
So I would assume this problem to be solved by now? -_-'
I assume this is for you Demon Fueled Torch?
So it's not the mod you advertise in your sign?
java.lang.NullPointerException - Signature cannot be null!
Now that's a good way to do it.
The answers in this thread are really nice and the sum of these posts explain the processes you can create in order to accomplish a mob repelling block.
I would say everything is solved neatly here now
This is of course, provided he is not just waiting for someone to just write the code for him.
Find out how I generate....coolAlias...world structure generation and rotation tool...
By the way, haven't ever touched vectors or velocity, so I would appreciate it if you could give me a boost. I'm not the best with entities(AKA I'm a huge scrub lord). Thanks!
In Java it would be written like:
Then the normalized vector would be:
Notice how there are commas separating the x, y, and z coordinates. It is mighty similar to a coordinate plane when you are writing it out.
Next, you should make sure you normalized the vector correctly. To do that, find its magnitude using the formula above. The magnitude should be very close to 1.
java.lang.NullPointerException - Signature cannot be null!
What are you looking for then?
If it's not knowledge and not code logic it sure would have to be the outright code?
What else could it be than the code written for you?
As theres been several working suggestions in this thread which works nicely(Iv'e tested them!)
Very nice explanation! Minecraft, however, provides a much simpler utility class: Vec3. Create a Vec3 object and then use the normalize() method - all the math done for you
Yeah... I forgot about the Minecraft class. Oh well.
java.lang.NullPointerException - Signature cannot be null!
Also since you only ever use those variables once it's ineffective (wasted cycles) to declare 6 variable only to be used once on the very next line. Especially considering that this happens once for every item in the list.
You probably would want to fix that clog
Secondly what is the purpose of the variable "f"?
EDIT: If you have an explanation a noob like me can read, please post it.
that's code from one of my modding experiments (making a telekinetic effect). If you can obtain an angle from your torch to the entity (I recommend finding an angle from their positions) , and put it in place of "player.rotationYawHead", it should simulate an actual blowback rather than just sort of reset their position.