[quote user_id="2931363" avatar="https://cravatar.eu/helmavatar/Mr_CookieSmurf/74.png" name="Mr_CookieSmurf"]
Code:
Boolean funForMassMurderers = noobEvent;
@EventHandler
public boolean onNoobEvent(jumpFromWallEvent event) {
Player player = event.getPlayer;
Player you = event.getPlayerOnGround;
if (player.usesBow) {
if (player.hits(you)) {
if (!you.hit(player)) {
return false;
}
}
}
}
Well this just makes me think you've been replaced with a computer :S
Java for noobs:
Boolean funForMassMurderers = noobEvent;
Boolean is the type it is. funForMassMurderers is the name by which it's referred to. noobEvent is what's used to get the answer of the boolean (true/false)
@EventHandler
Means that the server is listening for the event to happen
public boolean onNoobEvent(jumpFromWallEvent event) {
public means that it's publicly accessible, boolean is the return type of the class, noobEvent is the name which you refer to the class to, (jumpFromWallEvent event) is first what the listener is listening for, and the "event" is what the jumpFromWallEvent is called inside the class.
Player player = event.getPlayer;
Player you = event.getPlayerOnGround;
Those two lines defines "player" and "you".
if (player.usesBow) {
if (player.hits(you)) {
if (!you.hit(player)) {
Those three lines checks if the players first uses his bow, then if he hits you with it, and lastly, if you don't hit the player.
return false;
If all three conditions are met, the boolean is returned false, which means that funForMassMurderers = false.
So no fun for Anrza, which implements massMurderer.
EDIT: Yea, I changed some stuff in the code now that I did wrong.[/quote]
And I'm just sitting here only being able to type my name in html.
I will learn Java/Html and some others next year on school though :3