The Meaning of Life, the Universe, and Everything.
Join Date:
11/17/2016
Posts:
363
Location:
USA (sadly)
Minecraft:
FavouriteDragon
Member Details
I want to make a custom melee attack that allows the player to infuse their hand with fire and punch with it. Basically, particles would spawn around the hand, and the player's next punch would do extra damage and set the enemy on fire.
Spawn some particles relative to the player. The hitting logic can go into one of the events. Here's a list of all forge events. I recommend either LivingAttackEvent or AttackEntityEvent.
The Meaning of Life, the Universe, and Everything.
Join Date:
11/17/2016
Posts:
363
Location:
USA (sadly)
Minecraft:
FavouriteDragon
Member Details
Ok thanks! I'll report if I have any trouble. And for the laser thing, I made it start and the player and stop at where I'm looking, so that it always renders like a beam (except when I'm facing the sky, so minecraft doesn't crash.)
The Meaning of Life, the Universe, and Everything.
Join Date:
11/17/2016
Posts:
363
Location:
USA (sadly)
Minecraft:
FavouriteDragon
Member Details
So uh.. I finally got around to doing this
Failed spectacularly.
Can you be of assistance?
I have a boolean, haveStatusControl, which keeps turning up false, even though I set it to true. I'm trying to make it so that only people who use this ability can have the effects.
Here's my event code:
You just need to go through the normal process of debug. The first step is you need to observe the execution and for that you can either (1) add console print statements at all the important parts of the code or (b) set breakpoints and run Eclipse in debug run mode.
With that you first need to confirm that each method of your code is being called when expected. After that you need to trace the code within each method to make sure the if statements, loop and other conditional code is all as expected.
The Meaning of Life, the Universe, and Everything.
Join Date:
11/17/2016
Posts:
363
Location:
USA (sadly)
Minecraft:
FavouriteDragon
Member Details
yeah I'm doing that right now- I can't seem to figure out the problem.
They're being called on a hit, but another problem I found is that the event applies to me too when hit by vanilla mobs; it should only apply to entities that have used the ability. Do you know any way to do that?
I have a method for getting a bender, but I can't use it, due to events requiring one parameter.
The Meaning of Life, the Universe, and Everything.
Join Date:
11/17/2016
Posts:
363
Location:
USA (sadly)
Minecraft:
FavouriteDragon
Member Details
Ok! Having some trouble with getting the player to be able to punch multiple times!
Basically
I'm trying to have an int value
That on every punch (entity attack event)
Decreases
And that when it gets to 0
My status control disappears (the thing that allows me to do the melee move)
However!
Right now I'm resetting the int on every event, so If I want to punch more than once, I'll keep punching, for forever- which is a problem.
Here's my event code: https://pastebin.com/Eft5HyF7 In my ability class, i'm defining an int also called punchesLeft, and I've created a getter for the int. However, i'm creating an int for the event every time i punch, so i can't use a getter in the event- and even if i could, i'd be creating a new instance of the ability, which is.. bad....
I also have my status control execute method, but previous attempts to incorporate punches left have failed.
On top of that, if I try creating a new instance of the stat control in my ability class, then set the punchesLeft, then spawn it, not only does it not work, it also changes the colour of my status control.
Any help to my problem would be much appreciated.
Ability Class Code: https://pastebin.com/ytpzbeME Status Control Execute Code:
@Override
public boolean execute(BendingContext ctx) {
return false;
}
Keep in mind that returning true gets rid of the status control, while returning false keeps it there
I want to make a custom melee attack that allows the player to infuse their hand with fire and punch with it. Basically, particles would spawn around the hand, and the player's next punch would do extra damage and set the enemy on fire.
How would I go about doing this?
Image Removed
~ Everybody's FavouriteDragon
Spawn some particles relative to the player. The hitting logic can go into one of the events. Here's a list of all forge events. I recommend either LivingAttackEvent or AttackEntityEvent.
Ok thanks! I'll report if I have any trouble. And for the laser thing, I made it start and the player and stop at where I'm looking, so that it always renders like a beam (except when I'm facing the sky, so minecraft doesn't crash.)
Image Removed
~ Everybody's FavouriteDragon
Also, forgot to mention that you will most likely need a tick handler for your particles.
So uh.. I finally got around to doing this
Failed spectacularly.
Can you be of assistance?
I have a boolean, haveStatusControl, which keeps turning up false, even though I set it to true. I'm trying to make it so that only people who use this ability can have the effects.
Here's my event code:
Here's my ability class where I'm setting the variable haveStatusControl:
I know I've probably screwed up with logic, but help is greatly appreciated!
Image Removed
~ Everybody's FavouriteDragon
Bump!
Image Removed
~ Everybody's FavouriteDragon
Can you help, Melonslise?
Image Removed
~ Everybody's FavouriteDragon
You just need to go through the normal process of debug. The first step is you need to observe the execution and for that you can either (1) add console print statements at all the important parts of the code or (b) set breakpoints and run Eclipse in debug run mode.
With that you first need to confirm that each method of your code is being called when expected. After that you need to trace the code within each method to make sure the if statements, loop and other conditional code is all as expected.
Usually then the problem will be very obvious.
yeah I'm doing that right now- I can't seem to figure out the problem.
They're being called on a hit, but another problem I found is that the event applies to me too when hit by vanilla mobs; it should only apply to entities that have used the ability. Do you know any way to do that?
I have a method for getting a bender, but I can't use it, due to events requiring one parameter.
Image Removed
~ Everybody's FavouriteDragon
Ok almost there! I found a way to get what I wanted- just working out some logic!!
Image Removed
~ Everybody's FavouriteDragon
yeah I've pretty much got it working!
Image Removed
~ Everybody's FavouriteDragon
Basically
I'm trying to have an int value
That on every punch (entity attack event)
Decreases
And that when it gets to 0
My status control disappears (the thing that allows me to do the melee move)
However!
Right now I'm resetting the int on every event, so If I want to punch more than once, I'll keep punching, for forever- which is a problem.
Here's my event code:
https://pastebin.com/Eft5HyF7
In my ability class, i'm defining an int also called punchesLeft, and I've created a getter for the int. However, i'm creating an int for the event every time i punch, so i can't use a getter in the event- and even if i could, i'd be creating a new instance of the ability, which is.. bad....
I also have my status control execute method, but previous attempts to incorporate punches left have failed.
On top of that, if I try creating a new instance of the stat control in my ability class, then set the punchesLeft, then spawn it, not only does it not work, it also changes the colour of my status control.
Any help to my problem would be much appreciated.
Ability Class Code:
https://pastebin.com/ytpzbeME
Status Control Execute Code:
Keep in mind that returning true gets rid of the status control, while returning false keeps it there
Image Removed
~ Everybody's FavouriteDragon
Bump!
Image Removed
~ Everybody's FavouriteDragon