Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nuriofernandez/grechworldareas
Spigot Minecraft server plugin that allows other plugins to work with world areas. Detecting player joins/leaves block breaks, etc.
https://github.com/nuriofernandez/grechworldareas
areas bukkit bukkit-plugin bukkitdev events minecraft-plugin permissions spigot world-protection
Last synced: 2 days ago
JSON representation
Spigot Minecraft server plugin that allows other plugins to work with world areas. Detecting player joins/leaves block breaks, etc.
- Host: GitHub
- URL: https://github.com/nuriofernandez/grechworldareas
- Owner: nuriofernandez
- Created: 2021-01-01T19:54:34.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2024-08-11T19:17:37.000Z (3 months ago)
- Last Synced: 2024-08-11T21:40:36.702Z (3 months ago)
- Topics: areas, bukkit, bukkit-plugin, bukkitdev, events, minecraft-plugin, permissions, spigot, world-protection
- Language: Java
- Homepage:
- Size: 22.2 MB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GrechWorldAreas
Spigot Minecraft server plugin that allows other plugins to work with world areas. Detecting player joins/leaves block breaks, etc.# Area definition
```yml
name: "Redo"
uuid: "63b4809c-b73e-4a26-a106-4e722fe9c454"
areas:
1:
end:
w: "world"
x: 1
y: 100
z: 1
yaw: 0
pitch: 0
start:
w: "world"
x: 3
y: 100
z: 3
yaw: 0
pitch: 0
```# Checking areas for location
```java
@EventHandler
public void onBlockClick(PlayerInteractEvent event) {
if (event.getAction() != Action.RIGHT_CLICK_BLOCK) return;Player player = event.getPlayer();
Location clickedBlock = event.getClickedBlock().getLocation();List areas = worldAreaFactory.fromLocation(clickedBlock);
String areasNames = areas.stream().map(WorldArea::getName).collect(Collectors.joining(","));player.sendMessage(ChatColor.translateAlternateColorCodes(
'&', "&cYou have clicked at a block inside: &a"+areasNames
));
}
```# Listening to an area movement event
```java
@EventHandler
public void onJoin(PlayerJoinAreaEvent event) {
Player player = event.getPlayer();
WorldArea area = event.getWorldArea();String message = ChatColor.translateAlternateColorCodes(
'&', "&aYou joined to &e" + area.getName()
);
player.sendTitle("World Areas", message, 1, 20, 1);
}@EventHandler
public void onLeave(PlayerLeaveAreaEvent event) {
Player player = event.getPlayer();
WorldArea area = event.getWorldArea();String message = ChatColor.translateAlternateColorCodes(
'&', "&cYou left to &e" + area.getName()
);
player.sendTitle("World Areas", message, 1, 20, 1);
}
```## Demonstration of results: