https://github.com/wasasquatch/playerairevents
Spigot API Extension for Jump Events
https://github.com/wasasquatch/playerairevents
Last synced: 5 months ago
JSON representation
Spigot API Extension for Jump Events
- Host: GitHub
- URL: https://github.com/wasasquatch/playerairevents
- Owner: WASasquatch
- Created: 2017-04-23T17:29:29.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-03T02:22:44.000Z (over 9 years ago)
- Last Synced: 2025-04-11T04:34:22.508Z (over 1 year ago)
- Language: Java
- Size: 104 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PlayerAirEvents
## A Spigot API Extension
### Example Usage
```java
@EventHandler
public void playerFall(PlayerFallEvent e) {
Player player = e.getPlayer();
if (player.isOnline()) {
player.sendMessage(ChatColor.translateAlternateColorCodes('&',
"&6You jumped &f" + e.getJumpedBlocks() + " &6and fallen &f" + e.getFallenBlocks() + " &6blocks."));
}
}
@EventHandler
public void playerFlying(PlayerFlyingEvent e) {
Player player = e.getPlayer();
if (player.isOnline()) {
player.sendMessage(
ChatColor.translateAlternateColorCodes('&', "&6You are flying with &f" + e.blocksToGround()
+ " &6blocks to the ground, which is of material type: " + e.getBlockBelow().getType()));
}
}
@EventHandler
public void playerJump(PlayerJumpEvent e) {
Player player = e.getPlayer();
if (player.isOnline()) {
player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&6You have jumped."));
}
}
@EventHandler
public void playerLanded(PlayerLandedEvent e) {
Player player = e.getPlayer();
if (player.isOnline()) {
player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&6You have landed. You jumped &f"
+ e.getJumpedBlocks() + " &6and fallen &f" + e.getFallenBlocks() + " &6blocks."));
}
}
@EventHandler
public void playerRising(PlayerRisingEvent e) {
Player player = e.getPlayer();
if (player.isOnline()) {
player.sendMessage(ChatColor.translateAlternateColorCodes('&',
"&6You are rising &f" + e.getJumpedBlocks() + " &6blocks."));
}
}
```