HomeJavaModsPlotSquared-PlaceholderExpansion
PlotSquared-PlaceholderExpansion
ModsJava

PlotSquared-PlaceholderExpansion

by alphablock4k · on Modrinth

⬇ Download on Modrinth
PlotSquared-PlaceholderExpansion — screenshot 1PlotSquared-PlaceholderExpansion — screenshot 2PlotSquared-PlaceholderExpansion — screenshot 3

PlotSquared PlaceholderAPI Expansion

A lightweight and efficient PlaceholderAPI expansion for PlotSquared that provides real-time plot ownership detection and flag checking. This expansion allows server administrators and plugin developers to check whether a player is currently standing on their own plot and query plot flags, enabling dynamic content, conditional permissions, and enhanced gameplay mechanics.

🎯 What Does This Expansion Do?

This expansion adds powerful placeholders that return true or false based on plot ownership and flag status. This is particularly useful for:

Example GIF

📝 Available Placeholders

Placeholder Description Return Value Use Case
%plotowner_on_own_plot% Checks if the player is standing on their own plot as the owner true or false Perfect for conditional logic in any plugin that supports PlaceholderAPI
%plotowner_on_own_plot_<flag>% Checks if a specific flag is set on the current plot true or false Check plot flags like PVP, FLY, USE, etc.

Important Note: The ownership placeholder specifically checks for plot ownership. Players who are only trusted or added as members will receive false.

Flag Examples

✨ Key Features

📋 Requirements

🔧 Installation Guide

Step 1: Download

Download the latest release JAR file

Step 2: Install

Place the downloaded JAR file into your server's PlaceholderAPI expansions folder:

plugins/PlaceholderAPI/expansions/

Important: Do NOT place this in the main plugins folder. This is an expansion, not a standalone plugin.

Step 3: Reload

Run the following command in your server console or in-game:

/papi reload

Step 4: Verify Installation

Check if the expansion loaded successfully:

/papi list

You should see plotowner in the list of loaded expansions.

Step 5: Test

Test the placeholders while standing on your plot:

/papi parse me %plotowner_on_own_plot%
/papi parse me %plotowner_on_own_plot_pvp%

You should see true if you're on your own plot, or false if you're not.

📖 Usage Examples

Example 1: DeluxeMenus - Conditional Items

Show a special item only when players are on their own plot:

plot_settings_item:
  material: COMPARATOR
  slot: 13
  display_name: "&6&lPlot Settings"
  lore:
    - "&7Click to configure your plot"
    - "&7Status: &a%plotowner_on_own_plot%"
  view_requirement:
    requirements:
      must_be_on_plot:
        type: string equals
        input: "%plotowner_on_own_plot%"
        output: "true"
  left_click_commands:
    - "[player] plot flag"

Example 2: FeatherBoard - Dynamic Scoreboard

Display plot ownership and flag status on your scoreboard:

board:
  title:
    text:
      - "&6&lMy Server"
  lines:
    line1:
      text: "&7━━━━━━━━━━━━━━━"
    line2:
      text: "&ePlot Owner: &f%plotowner_on_own_plot%"
    line3:
      text: "&ePVP Enabled: &f%plotowner_on_own_plot_pvp%"
    line4:
      text: "&eFlight: &f%plotowner_on_own_plot_fly%"
    line5:
      text: "&eLocation: &f%player_world%"
    line6:
      text: "&7━━━━━━━━━━━━━━━"

Example 3: ConditionalEvents - Flag-Based Events

Execute commands based on plot flags:

pvp_zone_enter:
  type: player_move
  conditions:
    - "%plotowner_on_own_plot_pvp% == true"
  actions:
    default:
      - "message: &c&lYou entered a PVP zone!"
      - "sound: ENTITY_ENDER_DRAGON_GROWL"

🔍 How It Works

The expansion uses the official PlotSquared API to:

  1. Convert the Bukkit player to a PlotSquared player object
  2. Get the plot at the player's current location
  3. Check if the plot exists
  4. For ownership: Verify if the player's UUID matches the plot owner's UUID
  5. For flags: Check if the specified flag is set on the plot
  6. Return true or false accordingly

This process is highly optimized and causes minimal performance impact, even with hundreds of players online.

🛠️ Building from Source

If you want to compile the expansion yourself:

Prerequisites

Build Steps

# Clone the repository
git clone https://github.com/AlphaBlock4k/PlotSquared-PlaceholderExpansion.git
cd PlotSquared-PlaceholderExpansion

# Build with Gradle
gradle clean build

# Or use the Gradle wrapper
./gradlew clean build  # Linux/Mac
gradlew.bat clean build  # Windows

The compiled JAR will be located in build/libs/Expansion-PlotOwner-1.0.1.jar

🤝 Integration with Other Plugins

This expansion works seamlessly with any plugin that supports PlaceholderAPI, including:

❓ Frequently Asked Questions

Q: Why does it show "false" when I'm trusted on a plot?
A: This expansion specifically checks for plot ownership. Only the plot owner will receive true. Trusted members and added players will receive false.

Q: Does this work with merged plots?
A: Yes! If you own a merged plot and stand anywhere on it, the placeholder will return true.

Q: Can I use this for road detection?
A: Yes! If the placeholder returns false and the player is in a plot world, they're either on a road or on someone else's plot.

Q: What's the performance impact?
A: Minimal. The expansion uses efficient PlotSquared API calls and includes error handling to prevent lag.

Q: Why is the identifier "plotowner" and not "plotsquared"?
A: PlaceholderAPI already has a built-in expansion with the identifier "plotsquared". To avoid conflicts, this expansion uses "plotowner".

Q: What happens if I delete the expansion and reload?
A: The expansion will be properly unregistered and removed from memory. This was fixed in version 1.0.1.

Q: Can I check any PlotSquared flag?
A: Yes! You can check any flag that PlotSquared supports. Just use %plotowner_on_own_plot_<flagname>% with the flag's name.

Q: What if a flag doesn't exist or isn't set?
A: The placeholder will return false if the flag doesn't exist or isn't set on the plot.

🐛 Troubleshooting

Expansion not loading

Placeholder shows nothing

Always shows "false"

Expansion still registered after deletion

👤 Author

AlphaBlock4k

🌟 Support

If you find this expansion useful, please consider:

📊 Version History

v1.0.1

v1.0.0


Made with ❤️ for the Minecraft community

Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more