GriefDefender Extensions
When using GriefDefender, you can use the following extensions to add additional functionality to your NPCs.
NPC Functions
Section titled “NPC Functions”- Functionq.npc.griefdefender()
Returns the NPC's UUID for use with the GriefDefender functions.
Returns{ "npcUUID": "string" } - Functionq.npc.griefdefender.economy_enabled()
Checks if the GriefDefender economy is enabled on the server.
Returns1 for true, or 0 - Functionq.npc.griefdefender.get_player_claims(<uuid>)
Returns an array of claims owned by a specific player UUID.
ReturnsArray<{ "uuid": "string", "displayName": "string", "ownerUUID": "string", "ownerName": "string" }> - Functionq.npc.griefdefender.is_wilderness()
Checks if the NPC is currently in a wilderness area (not in a claim).
Returns1 for true, or 0 - Functionq.npc.griefdefender.available_rentals()
Returns an array of claims that are available for rent.
ReturnsArray<{ "uuid": "string", "displayName": "string", "ownerUUID": "string", "ownerName": "string", "rentalRate": double, "isForRent": false, "isRented": false, "renter": "string", "paymentType": "string", "rentMinTime": 0, "rentMaxTime": 0 }> - Functionq.npc.griefdefender.available_forsale()
Returns an array of claims that are available for sale.
ReturnsArray<{ "uuid": "string", "displayName": "string", "ownerUUID": "string", "ownerName": "string", "isForSale": false, "salePrice": double }> - Functionq.npc.griefdefender.claim_data()
Returns the claim data for the claim the NPC is currently in, if any.
Returns{ "uuid": "string", "displayName": "string", "ownerUUID": "string", "ownerName": "string" } - Functionq.npc.griefdefender.claim_uuid()
Returns the UUID of the claim the NPC is currently in, if any.
Returns"string" or 0 if not in a claim - Functionq.npc.griefdefender.claim_name()
Returns the name of the claim the NPC is currently in, if any.
Returns"string" or 0 if not in a claim - Functionq.npc.griefdefender.claim_owner_uuid()
Returns the UUID of the owner of the claim the NPC is currently in, if any.
Returns"string" or 0 if not in a claim - Functionq.npc.griefdefender.claim_owner_name()
Returns the name of the owner of the claim the NPC is currently in, if any.
Returns"string" or 0 if not in a claim - Functionq.npc.griefdefender.claim_rental_data()
Returns the rental data for the claim the NPC is currently in, if any.
Returns{ "uuid": "string", "displayName": "string", "ownerUUID": "string", "ownerName": "string", "rentalRate": double, "isForRent": false, "isRented": false, "renter": "string", "paymentType": "string", "rentMinTime": 0, "rentMaxTime": 0 } - Functionq.npc.griefdefender.claim_sale_data()
Returns the sale data for the claim the NPC is currently in, if any.
Returns{ "uuid": "string", "displayName": "string", "ownerUUID": "string", "ownerName": "string", "isForSale": false, "salePrice": double } - Functionq.npc.griefdefender.claim_tax_data()
Returns the tax data for the claim the NPC is currently in, if any.
Returns{ "uuid": "string", "displayName": "string", "ownerUUID": "string", "ownerName": "string", "spawnPos": "string", "taxPastDueDate": "string", "taxBalance": double }
Player Functions
Section titled “Player Functions”- Functionq.player.griefdefender()
Returns the player's UUID for use with the GriefDefender functions.
Returns{ "playerUUID": "string" } - Functionq.player.griefdefender.economy_enabled()
Checks if the GriefDefender economy is enabled on the server.
Returns1 for true, or 0 - Functionq.player.griefdefender.available_rentals()
Returns an array of claims that are available for rent.
ReturnsArray<{ "uuid": "string", "displayName": "string", "ownerUUID": "string", "ownerName": "string", "rentalRate": double }> - Functionq.player.griefdefender.available_forsale()
Returns an array of claims that are available for sale.
ReturnsArray<{ "uuid": "string", "displayName": "string", "ownerUUID": "string", "ownerName": "string", "isForSale": false, "salePrice": double }> - Functionq.player.griefdefender.claims(<uuid>)
Returns an array of claims owned by a specific player UUID.
ReturnsArray<{ "uuid": "string", "displayName": "string", "ownerUUID": "string", "ownerName": "string" }> - Functionq.player.griefdefender.current_claim()
Returns the claim data for the claim the player is currently in, if any.
ReturnsUUID as string or 0 - Functionq.player.griefdefender.accrued_claim_blocks()
Returns the number of accrued claim blocks the player has.
ReturnsAn Integer - Functionq.player.griefdefender.blocks_accrued_per_hour()
Returns the number of claim blocks the player accrues per hour.
ReturnsAn Integer - Functionq.player.griefdefender.max_accrued_claim_blocks()
Returns the maximum number of accrued claim blocks the player can have.
ReturnsAn Integer - Functionq.player.griefdefender.max_bonus_claim_blocks()
Returns the maximum number of bonus claim blocks the player can have.
ReturnsAn Integer - Functionq.player.griefdefender.max_claim_level()
Returns the maximum claim level the player can have.
ReturnsAn Integer - Functionq.player.griefdefender.min_claim_level()
Returns the minimum claim level the player can have.
ReturnsAn Integer - Functionq.player.griefdefender.bonus_claim_blocks()
Returns the number of bonus claim blocks the player has.
ReturnsAn Integer - Functionq.player.griefdefender.initial_claim_blocks()
Returns the number of initial claim blocks the player has.
ReturnsAn Integer - Functionq.player.griefdefender.remaining_claim_blocks()
Returns the number of remaining claim blocks the player has.
ReturnsAn Integer - Functionq.player.griefdefender.max_claimable_blocks()
Returns the maximum number of claimable blocks the player can have.
ReturnsAn Integer - Functionq.player.griefdefender.rental_limit()
Returns the rental limit for the player.
ReturnsAn Integer - Functionq.player.griefdefender.start_purchase(<claimUUID>)
Attempts to start a purchase for the specified claim.
Returns1 for success or 0
Server Functions
Section titled “Server Functions”- Functionq.server.griefdefender()
Returns the server's platform for use with the GriefDefender functions.
Returns{ "serverPlatform": "string" } - Functionq.server.griefdefender.economy_enabled()
Checks if the GriefDefender economy is enabled on the server.
Returns1 for true, or 0 - Functionq.server.griefdefender.get_player_claims(<uuid>)
Returns an array of claims owned by a specific player UUID.
ReturnsArray<{ "uuid": "string", "displayName": "string", "ownerUUID": "string", "ownerName": "string" }>
World Functions
Section titled “World Functions”- Functionq.world.griefdefender()
Returns the world's name for use with the GriefDefender functions.
Returns{ "location": "string" } - Functionq.world.griefdefender.economy_enabled()
Checks if the GriefDefender economy is enabled on the server.
Returns1 for true, or 0 - Functionq.world.griefdefender.get_player_claims(<uuid>)
Returns an array of claims owned by a specific player UUID.
ReturnsArray<{ "uuid": "string", "displayName": "string", "ownerUUID": "string", "ownerName": "string" }> - Functionq.world.griefdefender.available_rentals()
Returns an array of claims that are available for rent.
ReturnsArray<{ "uuid": "string", "displayName": "string", "ownerUUID": "string", "ownerName": "string", "rentalRate": double }> - Functionq.world.griefdefender.available_forsale()
Returns an array of claims that are available for sale.
ReturnsArray<{ "uuid": "string", "displayName": "string", "ownerUUID": "string", "ownerName": "string", "isForSale": false, "salePrice": double }> - Functionq.world.griefdefender.is_wilderness(x, y, z)
Checks if the specified coordinates are in a wilderness area (not in a claim).
Returns1 for true or 0 - Functionq.world.griefdefender.get_claim_uuid(x, y, z)
Returns the UUID of the claim at the specified coordinates, if any.
Returnsstring or 0 - Functionq.world.griefdefender.get_claim_name(x, y, z)
Returns the name of the claim at the specified coordinates, if any.
Returnsstring or 0 - Functionq.world.griefdefender.get_claim_owner_uuid(x, y, z)
Returns the UUID of the owner of the claim at the specified coordinates, if any.
Returnsstring or 0 - Functionq.world.griefdefender.get_claim_owner_name(x, y, z)
Returns the name of the owner of the claim at the specified coordinates, if any.
Returnsstring or 0