A WorldEdit extension plugin for TotalFreedom servers that adds:
- SelectionChangedEvent - Fires when a player's WorldEdit selection changes
- LimitChangedEvent - Fires when a player's block change limit is modified
- WorldEditOperationEvent - Fires before WorldEdit operations execute (e.g., //set, //replace, //fill)
- Super admin bypass for disallowed blocks (requires TotalFreedomMod)
- WorldEdit 7.3.x
- Paper/Spigot 1.21.x
- TotalFreedomMod (optional, for super admin features)
- Place
TF-WorldEdit.jarin yourplugins/folder - Ensure WorldEdit is installed
- Restart your server
Fires when a player's WorldEdit selection changes. Can be cancelled to prevent the selection.
@EventHandler
public void onSelectionChange(SelectionChangedEvent event) {
Player player = event.getPlayer();
Vector min = event.getMinVector();
Vector max = event.getMaxVector();
World world = event.getWorld();
// Handle selection change
// Cancel the selection if needed
// event.setCancelled(true);
}Fires when a player's block change limit is modified via //limit. Can be cancelled or the limit can be modified.
@EventHandler
public void onLimitChange(LimitChangedEvent event) {
Player player = event.getPlayer();
Player target = event.getTarget();
int limit = event.getLimit();
// Modify the limit
event.setLimit(5000);
// Or cancel the change
// event.setCancelled(true);
}Fires before a WorldEdit operation executes (e.g., //set, //replace, //fill). Can be cancelled to prevent the operation.
Important: This event intercepts at the command level. For comprehensive protection, you may also need to listen to BlockBreakEvent and BlockPlaceEvent at the Bukkit level, as some WorldEdit operations may bypass command events.
@EventHandler
public void onWorldEditOperation(WorldEditOperationEvent event) {
Player player = event.getPlayer();
World world = event.getWorld();
Vector min = event.getMinVector();
Vector max = event.getMaxVector();
WorldEditOperationEvent.OperationType type = event.getOperationType();
String command = event.getCommand();
// Check if operation is in a protected area
if (isInProtectedArea(world, min, max)) {
event.setCancelled(true);
player.sendMessage("§cYou cannot perform WorldEdit operations in this area.");
}
}If TotalFreedomMod is installed, super admins can use blocks that are in WorldEdit's disallowed blocks list. This is handled automatically through the WorldEditHandler.isSuperAdmin() method.
./gradlew buildThe JAR will be in build/libs/TF-WorldEdit-2.0.0.jar
This extension was created to modernize TF-WorldEdit (a fork of WorldEdit 6.1.7) by:
- Extracting unique features from the fork
- Creating a standalone extension plugin
- Making it compatible with WorldEdit 7.3.x and Minecraft 1.21.x
This plugin follows the same license as WorldEdit (LGPL v3).