-
Notifications
You must be signed in to change notification settings - Fork 0
All Conditions
Conditions are the "brains" of BeaconPlus. They determine who receives an effect, when an upgrade is possible, and which entities are ignored. This document provides a deep dive into the condition system, logic gates, and filtering syntax.
Every condition in BeaconPlus is a map containing a Type and optional logic flags.
-
Type: The ID of the condition logic. -
Negate: (Boolean) If set totrue, the condition's result is flipped. A "Success" becomes a "Failure", and vice versa. -
Performance Note: Simple conditions (like
HAS_PERMISSION) are processed instantly. Complex filters (likeTYPE_FILTER) or those scanning inventories (HAS_ITEM) have a higher processing cost. In a server with hundreds of beacons, avoid unnecessary inventory scans.
Checks if the target player possesses a specific permission node.
- Mechanics: Uses the standard Vault/Permissions API.
-
YAML Example:
- Type: HAS_PERMISSION Permission: "beaconplus.vip.perks" Negate: false
Checks what item the player is currently holding in their main hand.
- Mechanics: Compares the held item against a template. Supports NBT, display names, and materials.
-
YAML Example:
- Type: IS_HOLDING Item: type: NETHERITE_SWORD meta: display-name: "&6Excalibur"
Scans the player's entire inventory for a specific item.
-
Precautions: This is more performance-intensive than
IS_HOLDING. Use it sparingly if the beacon range is very large or if there are many entities. -
YAML Example:
- Type: HAS_ITEM Item: type: EMERALD amount: 64
Specifically checks for enchantments on the held item.
-
Parameters:
-
Enchantment: The name of the enchantment (e.g.,SHARPNESS,DIG_SPEED). -
Level: The minimum level required.
-
-
YAML Example:
- Type: IS_ITEM_IN_HAND_ENCHANTED Enchantment: "SHARPNESS" Level: 5
The most powerful tool for targeting specific mobs or groups.
-
Mechanics: Uses a custom-built logical string parser.
-
Filter Syntax Mastery:
-
Keywords:
ANIMALS,MONSTER,CREATURE,TAMED,ENEMY, and anyEntityType(e.g.,ZOMBIE,CREEPER). -
Operators:
and(&&),or(||),xor(^),not(!). -
Grouping: Use parentheses
( )for complex priority.
-
Keywords:
-
Examples:
-
MONSTER and not CREEPER: Affects all monsters except creepers. -
ZOMBIE or SKELETON: Affects only those two types. -
(ANIMALS or VILLAGER) and !TAMED: Affects wild animals and villagers, but ignores pets.
-
-
YAML Example:
- Type: TYPE_FILTER Filter: "MONSTER and !CREEPER"
Restricts the effect/condition to specific worlds.
-
YAML Example:
- Type: WORLD_WHITELIST World List: - world - world_nether
Checks the raw "Potential Power" of the beacon (based on its pyramid).
-
YAML Example:
- Type: POWER_REQUIREMENT Minimum: 100 Maximum: 500
Checks if the beacon has enough unused power. This is crucial for effects that should "shut down" if too many other things are running.
-
YAML Example:
- Type: FREE_POWER_REQUIREMENT Minimum: 10
Checks how many different effects are currently toggled on at this beacon. Useful for "balancing" high-tier rewards.
You can combine any number of conditions using logic gates. These gates can be nested indefinitely.
Succeeds only if ALL nested conditions are met.
YAML Example:
- Type: AND_LOGIC
Conditions:
- Type: HAS_PERMISSION
Permission: "beaconplus.vip"
- Type: POWER_REQUIREMENT
Minimum: 200Succeeds if AT LEAST ONE nested condition is met.
YAML Example:
- Type: OR_LOGIC
Conditions:
- Type: HAS_PERMISSION
Permission: "beaconplus.admin"
- Type: HAS_ITEM
Item:
type: NETHER_STARConditions can also target the beacon's unique Whitelist/Blacklist.
-
IS_WHITELISTED: Success if the player is on the beacon's whitelist. -
IS_BLACKLISTED: Success if the player is on the beacon's blacklist. -
HAS_WHITELIST: Success if the beacon owner has actually enabled a whitelist.
-
Logic Depth: While you can nest
AND_LOGICinsideOR_LOGICinside anotherAND_LOGIC, each layer adds a tiny amount of overhead. Try to flatten your logic where possible. -
Filter Strings: Be precise in your
TYPE_FILTER. Using(ZOMBIE or CREEPER or SKELETON or SPIDER)is slightly faster thanMONSTER. -
Permissions: Permissions are the most efficient way to handle player tiers. If you have "VIP Effects", use
HAS_PERMISSIONas the very first condition in anAND_LOGICblock to "short-circuit" the check for regular players. -
Inventory Scans: Avoid using
HAS_ITEMfor effects that tick every second (like standard Potion effects) if you have many players. It forces the server to iterate through 36+ inventory slots every tick.
Beacon.yml
All Beacon Effects
- 1. Potion Effect
- 2. Immortality Field
- 3. Potion Duration Boost
- 4. Flight
- 5. Magnet
- 6. Spawner Boost
- 7. Crops Boost
- 8. Keep Chunk Loaded
- 9. Apply Mending
- 10. Command Executor
- 11. Glow
- 12. Attribute Modifier
- 13. Cooldown Reduction
- 14. EXP Boost
- 15. EXP Gain
- 16. Extra Power
- 17. Extra Range
- 18. Fire Control
- 19. Furnace Boost
- 20. Permission
- 21. Prevent Mob Spawning
- 22. Saturation
- 23. Stupid AI