Jump to content
  • 0

[Request] Help with a very small code


Question

Posted

Hello, i would like to ask something, i added in my pack a code to hit players with CTRL. But i have a problem, if i have target my self, i can hit myself.

lol, that sounds weird. Anyway, i want a code to do when you have target yourself, to cancel the attack or something. I Tried this:

 

if(getTarget() == this)
{
return false;
}

 

But when the other player has target himself, i can't hit him. any other ideas? Well i am newbie in java, so i have no idea what to do :S

Thanks

1 answer to this question

Recommended Posts

  • 0
Posted

Hello, i would like to ask something, i added in my pack a code to hit players with CTRL. But i have a problem, if i have target my self, i can hit myself.

lol, that sounds weird. Anyway, i want a code to do when you have target yourself, to cancel the attack or something. I Tried this:

 

if(getTarget() == this)
{
return false;
}

 

But when the other player has target himself, i can't hit him. any other ideas? Well i am newbie in java, so i have no idea what to do :S

Thanks

 

Give more info,maybe you add it in the wrong place.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..