CyberLevels

Anti Abuse

Anti abuse provides basics to prevent XP spam or abuse in order to keep fair gameplay.

We're sure you don't want to see your players suffer from being abused by others hacking the system and getting more EXP doing various things to speed up the process.

This is why we have the Anti Abuse module, which provides you with the basics to prevent EXP spam or abuse in order to keep fair gameplay.

Set general anti-abuse options

You can set general anti-abuse options in the anti-abuse.yml file. This file is located in the plugin's folder. Here's how it looks like:

anti-abuse.yml
anti-abuse:
  general:
    # Should pickaxes with silk touch reward EXP
    # when breaking a block?
    silk-touch-reward: false

    # When a block is broken, must it be naturally
    # generated to gain EXP?
    only-natural-blocks: false

    # Should crops be included in the only-natural-
    # blocks list? If false, the crop must be fully
    # grown to gain EXP. 
    include-natural-crops: false

    # If you would like more general anti-abuse option
    # to be added, make sure to mention them on our
    # Discord: https://discord.gg/DC4Gqj3y5V

# ... code ...

The general is pretty straightforward. You can set the following options:

  • silk-touch-reward: Whether pickaxes with silk touch should reward EXP when breaking a block.
  • only-natural-blocks: Whether only naturally generated blocks should reward EXP when broken.
  • include-natural-crops: Whether crops should be included in the only-natural-blocks list. If false, the crop must be fully grown to gain EXP.

How the module works

Let's get our hands on one of the examples in the anti-abuse.yml file. This file is where you can set up your anti-abuse rules and modules.

We'll start examining the last example module in the default version of the file:

# ... code ...

  any-name-you-want:
    exp-events:
      - 'killing-players'
      - 'killing-animals'
      - 'killing-monsters'

    cooldown:
      enabled: false
      time: 5

    limiter:
      enabled: false
      amount: 250
      timer: '2022-01-15 00:00 12h'

    worlds:
      enabled: false
      whitelist: true
      list:
        - 'world'
        - 'world_nether'
        - 'world_the_end'

Explanation of the variables

As you can see, the module is named any-name-you-want, but you can name it whatever you want. The important part is that it contains the following sections:

  • exp-events: A list of events that will be monitored for abuse. In this case, it includes killing players, animals, and monsters.
  • cooldown: A section that allows you to set a cooldown for the events. If enabled, players will have to wait a certain amount of time before they can earn EXP from the same event again.
    • enabled: Whether the cooldown is enabled or not.
    • time: The cooldown time in seconds.
  • limiter: A section that allows you to limit the amount of EXP a player can earn from the events.
    • enabled: Whether the limiter is enabled or not.
    • amount: The maximum amount of EXP a player can earn from the events.
    • timer: The time period in which the limiter applies.
  • worlds: A section that allows you to limit the events to certain worlds.
    • enabled: Whether the world limitation is enabled or not.
    • whitelist: Whether the list below is a whitelist (true) or a blacklist (false).
    • list: A list of worlds that the events will work in (whitelist) or not work in (blacklist).

Where to get exp-events?

You can find the list of available exp-events in the Earning EXP documentation. It contains all the events that can be monitored for abuse.

Just please make sure you write the event names correctly, as they are case-sensitive. So if you found Killing Animals in the documentation, you must use killing-animals and not Killing Animals or KILLING_ANIMALS.

What does the limiter do?

The limiter is a way to prevent players from earning too much EXP from the same event in a short period of time. For example, if you set the amount to 250, players will not be able to earn more than 250 EXP from killing players, animals, or monsters until the timer resets.

Timers are reboot immune, meaning that they will continue to work even if the server is restarted. This is useful to prevent players from abusing the system by restarting the server to reset the timers.

You SHOULD know how to properly use timers. For that, please refer to the Schedulers documentation from XenoWorldReset, where everything is explained in details.

TL;DR on the timer

  • The format is YYYY-MM-DD HH:MM i (interval).
    • YYYY: The year of the first reset.
    • MM: The month of the first reset.
    • DD: The day of the first reset.
    • HH: The hour of the first reset.
    • MM: The minute of the first reset.
    • i: The interval for the timer. This can be in seconds, minutes, hours, or days. For example, 6h means 6 hours.
  • The first time the timer will reset is at the specified date and time. From that point on, it will reset every interval specified.
  • The timer will continue to work even if the server is restarted, so you don't have to worry about it resetting when the server is down.

Want to select only certain worlds?

You can also limit the events to certain worlds. For that, you can use the worlds section. Here's how it looks like:

  any-name-you-want:
    # What events should be included in this module?
    exp-events:
      - 'killing-players'
      - 'killing-animals'
      - 'killing-monsters'

    cooldown:
      enabled: false
      time: 5

    limiter:
      enabled: false
      amount: 250
      timer: '2022-01-15 00:00 12h'

    worlds: 
      enabled: false

      # Should the list below be a whitelist (true)
      # or a blacklist (false)?
      whitelist: true

      # A list of worlds that these events will work
      # in (whitelist) or not work in (blacklist).
      list:
        - 'world'
        - 'world_nether'
        - 'world_the_end'

Conclusion

Anti abuse is a powerful module that allows you to prevent players from abusing the system and getting more EXP than they should. You can set up your own rules and modules to fit your server's needs.

With this, you can ensure that your players have a fair and balanced experience while playing on your server.

Last updated on