PerWorldRules icon

PerWorldRules -----

Sets up /rules that are unique to each world



General Information:

At a user's request, I added the ability to restrict actions based on rule acceptance. You can stop people from moving, chatting, picking up items, breaking blocks or interacting with things until they accept rules. This will only take effect if there are rules - so if you have move restriction enabled and the player goes to a world with no rules, just be aware they will be able to move about without accepting rules. Because it'd be stupid to restrict them until they agree with... nothing lol.

Worlds can be grouped. Like if you have world, world_nether and world_the_end you can set it such that if they accept rules in one, they have accepted in all. The nether and end worlds are "subworlds" of overworld. It uses string matching, so if you set subworlds true for "minigame", then accepting rules in minigame also applies to minigame_nether and minigame_the_end. If minigame's nether world is instead called minigame_hell, it will not carry the rule acceptance over.

OPs are by default excluded from rule restrictions, and if you want to exclude players give them perworldrules.accept.exempt.

Commands:

RULES

perworldrules.view
perworldrules.view.(world)

Show the rules for the world they are in. Players need both view and view for the world. Don't forget wildcards exist; so you can issue perworldrules.view and perworldrules.view.* in your permissions manager to simplify things.

RULES EDIT (world)
perworldrules.edit
perworldrules.edit.(world)

This is the 1.13+ interface. Edits the rules for the world. As with view, you need both permissions. If you omit world, it uses the world you are in.

RULES EDIT world (line) (+) (text)
perworldrules.edit
perworldrules.edit.(world)

This is the 1.12 and older interface for editing rules. See the miscellaneous section for details.

RULES DEL (world)
perworldrules.delete
perworldrules.delete.(world)

Deletes rules for a world. If you omit world, it uses the world you are in.

RULES ACCEPT
perworldrules.accept
Accepts the rules for a world.

RULES ACCEPT (player) (world)
perworldrules.accept.others
Accepts the rules for a world for another player

RULES WIPEUSER (player)
perworldrules.wipeuser
Wipes all rule read/accept settings for the player

RULES CFG
perworldrules.cfg
Access the configuration commands

RULES CFG REQUIREDFOR (action) (true | false)
perworldrules.cfg.requiredfor
Sets actions that require rule acceptance. Valid action options are chat, move, itempickup, interact and blockbreak. Pass the action only to view current setting.

RULES CFG SUBWORLDS (world) (true | false)
perworldrules.cfg.subworlds
Sets if worlds should be grouped. Pass the world only to view current setting.

RULES CFG DELAY (value) (world)
perworldrules.cfg.delay
Sets the required delay for acceptance post reading for a world. Use _default_ to set a global delay. If a world specific value is present, that is used in lieu of the default.

RULES CFG LINKWORLDS (parent) (child) [/D]
perworldrules.linkworlds
Links a child world to a parent. So if you put world as parent and survival as child, then the rules from world will be displayed when you do /rules in survival. If you are in world and accept rules, then when you go to survival they will be accepted there. Similar the other direction, if you accept in survival they also are accepted in world. Pass /D to delete a world link.

RULES LIST
perworldrules.list
Lists worlds that have rules set

RULES RELOAD
perworldrules.reload
Reloads configuration


Miscellaneous:


The rules support standard formatting codes using &.

Special World Names:

There are two special world names you can use; _global_ and _default_. Global rules will be displayed all the time, no matter what world you are on. Default rules will be displayed only when a world has no specific rules. So for example, let's say you have these rules:

_default_: Don't be a jerk
_global_: Don't grief
world: Don't leave tree tops floating in the air
world_the_end: Leave the Enderdragon alone

Now if someone is in the world "world" and does /rules, they see:
Don't leave tree tops floating in the air
Don't grief


If they do /rules in "world_the_end" they see:
Leave the Enderdragon alone
Don't grief


If they do /rules in "world_nether" they see:
Don't be a jerk
Don't grief

Read/Accept Delay:

If you want to have a delay between reading rules and accepting, set the number of seconds using /rules cfg delay # world. You can set a default for any world that isn't specific, and specific world requirements. So if you wanted to have a 5 second delay overall, but a 1 minute delay in world "survival" the config would look like this:
Code (Java):
config :
  accept -delay -post -read :
    _default_ : 5
    survival : 60
The message for people when they try to accept too fast has a variable "%time%" to show the time remaining. It defaults such that if a person has 65 seconds left, it will look like:

"You have not taken enough time to read the rules! 1 minute, 5 seconds left before you can accept"

That is localizable in the config using these paths:
Code (Text):
messages:
  day:
    single: ' day'
    plural: ' days'
  hour:
    single: ' hour'
    plural: ' hours'
  minute:
    single: ' minute'
    plural: ' minutes'
  second:
    single: ' second'
    plural: ' seconds'
  time-delimiter: ', '
  value-padding:
    length: 0
    char: '0'
    from: left
If you wanted it to be like 01:20:17 if the delay left is an hour, twenty mins and 17 secs you can do:
Code (Text):
messages:
  day:
    single: ''
    plural: ''
  hour:
    single: ''
    plural: ''
  minute:
    single: ''
    plural: ''
  second:
    single: ''
    plural: ''
  time-delimiter: ':'
  value-padding:
    length: 2
    char: '0'
    from: left
1.12 and older editing:

I realized that the writable book breaks if this is ran on 1.12 or older. To fix that, I brought back line based editing. So lets say these are the rules in survival:

Don't grief
Don't leave 1 stack pillars everywhere
Don't be a dick
Don't leave floating treetops


If I want to edit them, I first should list them to get their line numbers:

/rules edit .

The period is shorthand for the current world. This is what I'd get:

[0]: Don't grief
[1]: Don't leave 1 stack pillars everywhere
[2]: Don't be a dick
[3]: Don't leave floating treetops


So if a parent complained that rule 2 is vulgar, I could do:

/rules edit . 2 Don't be a jerk

And that will change that rule, making these the rules:

Don't grief
Don't leave 1 stack pillars everywhere
Don't be a jerk
Don't leave floating treetops

If I wanted to insert a rule, I would pass a + after the line number. So if I did:

/rules edit . 2 + Don't steal peoples' stuff

...and the rules would now be:

Don't grief
Don't leave 1 stack pillars everywhere
Don't steal peoples' stuff
Don't be a jerk
Don't leave floating treetops

If I want to delete a line, I set the content to delete. So if I don't care about pillars anymore, I can do:

/rules edit . 1 delete

...and the rules would now be:

Don't grief
Don't steal peoples' stuff
Don't be a jerk
Don't leave floating treetops

If there are no rules at all, just use line 0 and it will insert the text as the first rule.
Resource Information
Author:
----------
Total Downloads: 624
First Release: Sep 22, 2019
Last Update: Jan 18, 2023
Category: ---------------
All-Time Rating:
3 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings