GithubHelp home page GithubHelp logo

land_claim's Introduction

Land Claim API

Allows for land claiming to be implemented into bdsx. This was made to be added to existing plugins like economy and such

This plugin adds 3 functions setClaim, removeClaim, and checkClaimed which set, remove or check if a position is claimed

Example usage

import {command} from "bdsx/command";
import {CxxString} from "bdsx/nativetype";
import {CommandPosition} from "bdsx/bds/command";
import {removeClaim, setClaim} from "./plugins/land_claim/index";

command.register(`claim`,'claim land').overload((params, origin, output)=>{
    const method = params.method
    if (method==="set") {
        const player = origin.getEntity()
        if (!player?.isPlayer()) return;
        if (params.point1===undefined || params.point2===undefined){
            output.error(`§cEnter a set of coordinates to claim the land`)
            return;
        }
        
        output.success(setClaim(player.getXuid(),player?.getName(), params.point1, params.point2).output)
    } else if (method==='remove'){
        const player = origin.getEntity()
        if (!player?.isPlayer()) return;
        const pos = {
            x:player?.getPosition().x,
            z:player?.getPosition().z
        }
        output.success(removeClaim(player.getXuid(),player?.getName(),pos).output)
    }
},{
    method:CxxString,
    point1:[CommandPosition, true],
    point2:[CommandPosition, true]
})

In the config.json file you are able to set how often the claim db is saved, if players with operator can bypass land claims as well as the limit of land claims players can have

{
  "save_interval": 10, 
  "ops_bypass": false,
  "claim_limit": {
    "limit": true,
    "amount": 5
  }
}

If you find any bugs or suggest any improvements let me know on discord. mudkiper107#8390

land_claim's People

Contributors

mudkiper107 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.