Laborus - a customizable job plugin

This is a discussion topic for the Ore project, Laborus. View the full project on Ore for downloads and more information.



This Project is no longer maintained, you can still download it or look at the source code at GitHub but no updates or support will be provided GitHub - Lergin/Laborus: a customisable sponge job plugin


a Minecraft job plugin for Sponge

  1. Features
  2. How to use
  3. Commands
  4. Configuration

Features

  • Jobs in Minecraft
  • reward the placing and destroying of Blocks, the using of items and the killing and taming of mobs
  • Job Abilities that eg. allow you to destroy blocks faster for 3 minutes every two hours
  • anti replace farming system that blocks the rewarding of the placing and destroying of blocks on the same spot so the economy isnā€™t as easily exploitable
  • only allow doing the actions (eg. destroying of a block) after a specific level
  • Job Boni like special or multiple drops or repairing of items
  • completely configurable and translatable

A full lists of all possible actions, boni and abilities can be found in the Configuration section.

How to use

To use this plugin you need a Sponge Server that is supporting the SpongeApi Version 5.2.
If you have a Server like this you only need to place the pluginfile into the mods folder.
When you have done this and you have started the server the default configuration file will automatically be added, but you still need to add the jobs you want to have to this file due to the missing of jobs in the default configuration.
Some ready configuration files with some jobs can be found in the Configuration Cookbook in the Github repository. These files can just be used to replace the automatically created config and will get all missing configuration keys after the next stop of the server.

Commands

/jobs addXP [job] [xp] [player]

This command adds the given amount of xp to the xp of the job.

Permission: laborus.commands.addXp

Permission for player arg: laborus.commands.addXp.other_player

/jobs change [join|leave] [job]

Joins or leaves the job. A job that is joined can give more xp for actions and special boni. The amount of jobs that can be joined can be limited.

Permission: none / can be set in the config

/jobs toggle

Activates or deactivates the job system for the player that executes this command.

Permission: laborus.commands.toggle

/jobs ability [job]

Starts the ability of the job.

Permission: laborus.commands.ability

/jobs info [job]

Shows information about the job if one is send with the command, otherwise a list of all jobs is shown.

Configuration

A Documentation of the Configuration Settings can be found in the Github Wiki or on Sponge Ore

External Connections

This plugin uses bStats to collect metrics about the usage. This can be deactivated in the bStats config.

Some ready configuration files you can find in the jobs folder in this repo.

The link does not work

Ah i just copied my readme from github and the link was relativ to the name of the repository so it hasnā€™t worked here and on oreā€¦ I just updated it so it links to the right url, thanks :slight_smile:

A new version has been released for Laborus, it is available for download here.


permission to join a job
various small improvements

A new version has been released for Laborus, it is available for download here.


The configuration system has been reworked completely, so all configs need to be rewritten.

  • complete rewrite of the configuration system
  • complete rewrite of the translation system
  • /jobs now is also an alias for /jobs info

A new version has been released for Laborus, it is available for download here.


  • fixed a bug with saving the config
  • saving the config also at the start of the server
  • added comments to a lot more configuration settings

A new version has been released for Laborus, it is available for download here.


  • support for extra config files for jobs and translations
  • added ā€˜itemā€™ parameter to translation of JOB_LEVEL_NOT_HIGH_ENOUGH
  • also react to Off-Hand in interaction actions
  • more comments for the configuration files

A new version has been released for Laborus, it is available for download here.


  • multi currency support
  • specific job messages for each job (through _jobid suffix)
  • reload command to reload the configuration while the server is running
  • fallbackLanguage setting

A new version has been released for Laborus, it is available for download here.


  • fixed multiple bugs with the economy reward
  • fixed a bug with the selection if a bonus can be awarded
  • added a setting to select on which actions a bonus will be applied
  • added some more comments for configuration nodes
1 Like

Youā€™ve ā€œlaborus.commands.addXp.outher_playerā€ as a permission.

Iā€™ve yet to check as still setting it up but Iā€™m assuming that itā€™s meant to be laborus.commands.addXp.other_player ?

If it turns out that permission is accurate Iā€™ll return and remove this, but flagging for now on the off-chance youā€™re about atm :slight_smile:

1 Like

Oh yes that shouldnā€™t be the case I will change that in the next version :slight_smile:

Made a pull-request to fix a couple of typos in a config on the Git too :slight_smile:

You just created a fork so I just copied them into a new commit that was just pushed to GitHub. Thanks for the help!

Ah, yes meant fork u.u
Still learning the ways of Git and Java :stuck_out_tongue:

Some queries over the configs though ā€¦

 jobFiles=[
    "miner.conf"
]

Is this correct?
Where should the miner.conf file be? I have it in the laborus directory alongside laborus.conf and laborus.mv.db. It doesnā€™t seem to be correct though. Due to an error in the miner.conf or a problem with where itā€™s saved to?

I also donā€™t understand how to add jobs directly to the config.

Iā€™d imagine under the Jobs=[] area?

This is what I have so far based on the docs Iā€™ve seen, but I donā€™t see how it would scale / allow more than one job to be entered.

jobs=[
  name=Miner
  id=miner
  description="The job of the game!"
  permission=""
  {
    ability {
      cooldown=600
      name="Fast Destroy"
      potionEffect {
        ambiance=false
        amplifier=2
        duration=1200
        particles=true
        potionType="minecraft:haste"
      }
    }
    actions {
      break=[
        {
          item="minecraft:stone[variant=stone]"
          needLevel=0
          xp=1
        },
        {
          item="minecraft:stone[variant=diorite]"
          needLevel=5
          xp=1.1
        },
        {
          item="minecraft:stone[variant=granite]"
          needLevel=15
          xp=1.1
        },
        {
          item="minecraft:stone[variant=andesite]"
          needLevel=10
          xp=1.1
        },
        {
          item="minecraft:coal_ore"
          needLevel=2
          xp=5
        },
        {
          item="minecraft:sandstone"
          needLevel=12
          xp=1.2
        },
        {
          item="minecraft:iron_ore"
          needLevel=8
          xp=10
        },
        {
          item="minecraft:gold_ore"
          needLevel=20
          xp=20
        },
        {
          item="minecraft:redstone_ore"
          needLevel=15
          xp=15
        },
        {
          item="minecraft:lapis_ore"
          needLevel=25
          xp=25
        },
        {
          item="minecraft:emerald_ore"
          needLevel=100
          xp=30
        },
        {
          item="minecraft:diamond_ore"
          needLevel=100
          xp=35
        },
        {
          item="minecraft:netherrack"
          needLevel=6
          xp=0.7
        },
        {
          item="minecraft:quartz_ore"
          needLevel=17
          xp=13
        },
        {
          item="minecraft:obsidian"
          needLevel=30
          xp=20
        },
        {
          item="minecraft:end_stone"
          needLevel=17
          xp=2
        }
      ]
      damage=[]
      kill=[]
      place=[]
      tame=[]
      use=[
        {
          item="minecraft:wooden_pickaxe"
          needLevel=0
          xp=0
        },
        {
          item="minecraft:stone_pickaxe"
          needLevel=5
          xp=0
        },
        {
          item="minecraft:iron_pickaxe"
          needLevel=15
          xp=0
        },
        {
          item="minecraft:golden_pickaxe"
          needLevel=25
          xp=0
        },
        {
          item="minecraft:diamond_pickaxe"
          needLevel=40
          xp=0
        }
      ]
    }
    bonus {
      economy=[]
      ep=[]
      itemDrop=[]
      itemRepair=[
        {
          maxLevel=-1
          maxPercent=0.2
          message {
            text="As if it was magic your tool has repaired itself a bit!"
          }
          minLevel=20
          minPercent=0.05
          onlySelected=true
          probability=0.005
          sendMessage=true
        }
      ]
      multiDrop=[
        {
          extraDrops=2
          maxLevel=-1
          message {
            text="Due to your skills you have gained more items from this block!"
          }
          minLevel=20
          onlySelected=true
          probability=0.03
          sendMessage=true
        }
      ]
    }
  }
]

Yes thatā€™s the correct syntax for that and the file then should be in the same folder as laborus.conf and yes the error is most likely in the miner.conf, if you send me the config i should be able to tell you where exactly the error is :slight_smile:

Other than that it may also help to look into the example configurations to find out how exactly something needs to be written: Laborus/ConfigurationCookbook at api_7.0 Ā· malte-laukoetter/Laborus Ā· GitHub

Here all the data you would normaly write into a extra job file needs to be between { and } so there also can be more than one job in the jobs area through adding more jobs between there one { and }.

So it would look like this:

jobs=[
  {
    name=Miner
    id=miner
    description="The job of the game!"
    permission=""
    ability {
      cooldown=600
      name="Fast Destroy"
      potionEffect {
        ambiance=false
        amplifier=2
        duration=1200
        particles=true
        potionType="minecraft:haste"
      }
    }
    actions {
      break=[
        {
          item="minecraft:stone[variant=stone]"
          needLevel=0
          xp=1
        },
        {
          item="minecraft:stone[variant=diorite]"
          needLevel=5
          xp=1.1
        },
        {
          item="minecraft:stone[variant=granite]"
          needLevel=15
          xp=1.1
        },
        {
          item="minecraft:stone[variant=andesite]"
          needLevel=10
          xp=1.1
        },
        {
          item="minecraft:coal_ore"
          needLevel=2
          xp=5
        },
        {
          item="minecraft:sandstone"
          needLevel=12
          xp=1.2
        },
        {
          item="minecraft:iron_ore"
          needLevel=8
          xp=10
        },
        {
          item="minecraft:gold_ore"
          needLevel=20
          xp=20
        },
        {
          item="minecraft:redstone_ore"
          needLevel=15
          xp=15
        },
        {
          item="minecraft:lapis_ore"
          needLevel=25
          xp=25
        },
        {
          item="minecraft:emerald_ore"
          needLevel=100
          xp=30
        },
        {
          item="minecraft:diamond_ore"
          needLevel=100
          xp=35
        },
        {
          item="minecraft:netherrack"
          needLevel=6
          xp=0.7
        },
        {
          item="minecraft:quartz_ore"
          needLevel=17
          xp=13
        },
        {
          item="minecraft:obsidian"
          needLevel=30
          xp=20
        },
        {
          item="minecraft:end_stone"
          needLevel=17
          xp=2
        }
      ]
      damage=[]
      kill=[]
      place=[]
      tame=[]
      use=[
        {
          item="minecraft:wooden_pickaxe"
          needLevel=0
          xp=0
        },
        {
          item="minecraft:stone_pickaxe"
          needLevel=5
          xp=0
        },
        {
          item="minecraft:iron_pickaxe"
          needLevel=15
          xp=0
        },
        {
          item="minecraft:golden_pickaxe"
          needLevel=25
          xp=0
        },
        {
          item="minecraft:diamond_pickaxe"
          needLevel=40
          xp=0
        }
      ]
    }
    bonus {
      economy=[]
      ep=[]
      itemDrop=[]
      itemRepair=[
        {
          maxLevel=-1
          maxPercent=0.2
          message {
            text="As if it was magic your tool has repaired itself a bit!"
          }
          minLevel=20
          minPercent=0.05
          onlySelected=true
          probability=0.005
          sendMessage=true
        }
      ]
      multiDrop=[
        {
          extraDrops=2
          maxLevel=-1
          message {
            text="Due to your skills you have gained more items from this block!"
          }
          minLevel=20
          onlySelected=true
          probability=0.03
          sendMessage=true
        }
      ]
    }
  },
  {
  second job
  },
  {
  third job
  }
]
```

I will soon also add an example for multiple jobs but i still need to finish the configuration for the third job ;)
1 Like

Should be what was on the Git.
http://pastebin.com/8d8KQ2nm

The problem should be that there is missing a new line in the middle of line 15 (behind item="minecraft:stone[variant=stone]") :wink:

Ah. Found that u.u

Silly me :stuck_out_tongue:
But still not working :confused:

EDIT:

Ah, nevermind, Iā€™d removed the miner.conf from the main config :smile:

Loads up now :slight_smile:
Thanks

1 Like

Is this correct for the kill section?

kill=[
    {
        item="minecraft:pigzombie"
        needLevel=0
        xp=1.5
    },
    {
        item="minecraft:zombie"
        needLevel=18
        xp=22.0
    }
]

Iā€™m also getting no experience after breaking blocks.

    {
        item="minecraft:coal_ore"
        needLevel=0
        xp=1.5
    },

Tested it on coal. The ability also seems to not be firing. It issues a printout that itā€™s ran, and one saying Iā€™ve used it too recently. I just didnā€™t see a boost in speed.

ability {
    cooldown=600
    name="Gold Rush"
    potionEffect {
        ambiance=true
        amplifier=2
        duration=15
        particles=true
        potionType="minecraft:haste"
    }
}

Whenever I log in my job has been deselected.
I also need to keep enabling the system with /jobs toggle.

I imagine as the system is being pretty much entirely non-functional Iā€™ve overlooked something somewhere :confused:

I do have all perms applied to me, and theyā€™re registering as true under LuckPermā€™s debugger so that at least seems okay. Iā€™m using job files (this one is archaeologist.conf) and have no permission defined for the job itself if that has any impact.

Iā€™ve done most of these tests in creative, but I tested the killing in survival.

1 Like

The kill section has the problem that minecraft:pigzombie isnā€™t a currect entity id (the correct one is minecraft:zombie_pigman see here) so the job wasnā€™t able to load (that should also create a error message in the server log) also note that the needLevel doesnā€™t work with killing actions so you also need to set the needLevel property of the same items with the damage section :wink:

Other than that the jobsystem works with the default configuration only in the survival and adventure mode (this can be changed with the enabledGamemodes setting).

The problem with the ability is mostelikley that 15 ticks isnā€™t a lot of time so the effect ends after not even a second.

The problem with the saving seems to be that it is only saved after the first ep of any job is gained, i will fix that in the next version until then it shouldnā€™t be a problem after the first ep has been collected (GitHub issue) :slight_smile:

1 Like