A mechanism or CraftBukkit plugin to not allow building or mining in Minecraft?
I'm trying to teach students how to program JavaScript inside Minecraft with ScriptCraft. It's been amazing, except for the fact that even my most focused students get so distracted with playing minecraft instead of learning to program. I need a way for them to essentially not be able to do anything in Minecraft if it wasn't done programmatically through JavaScript.
ScriptCraft requires running a CraftBukkit server. Is there a mechanism to do disallow mining or building in Minecraft, CraftBukkit or a CraftBukkit plugin?
Solution 1:
PermissionsEx and ModifyWorld should solve this problem quite nicely.
PermissionsEx is a general permissions plugin and ModifyWorld is an optional part of PEX:
[ModifyWorld] provides the possibility to control players abilities, such as destroying/placing blocks, riding carts/boats or even getting spotted by mobs and much more. Disabled by default.
The PEX wiki has a nice series of articles explaining exactly how to setup PEX with modofyworld. I suggest you follow along the tutorial so you understand how to install and configure PEX. Then when you get to the "Basic-Permissions-Setup" page, use my suggested configuration instead of theirs.
config.yml:
permissions:
backends: <- Backend Definition Section
file: <- File Based Backend Section
file: permissions.yml <- File Name To Use
backend: file <- Backend To Use On Start
superperms: <- Settings For SuperPerm Support
enable-wildcards: true
disable-unmatched: false
enable: true
debug: false
compatibility-mode: false
createUserRecords: false <- Other Settings
allowOps: false
debug: false
basedir: plugins/PermissionsEx <- Directory Name To Use
Once this is done, it sounds like this ought to work as your permissions.yml:
groups:
#default group
default:
default: true
prefix: '&0(&4Default&0)&7 '
permissions:
- -modifyworld.* #All permissions, equivalent to current setup
#students
students:
default: false
permissions:
- modifyworld.chat
- modifyworld.sneak
- modifyworld.sprint
- modifyworld.blocks.interact.69 #Allow levers
- -modifyworld.*
#teacher
teacher:
default: false
permissions:
- modifyworld.*
- permissions.*
users:
SomeStudent:
group:
- students
SomeOtherStudent:
group:
- students
YetAnotherStudent:
group:
- students
at01:
group:
- Teacher
This puts the listed students into the students group, which denies all permissions except those specifically listed. You may want to browse the block ID list and allow modifyworld.blocks.interact.<Block ID>
with some more of them (e.g. chests, buttons, doors). Make sure to use the "Dec" value listed, not the "Hex". You may also want to browse the permissions list to check for other things you want to allow students to do.
If you miss any student names they will be allowed to do everything, which is equivalent to the permissions they have right now. If any students are in this group when they chat their name will be prefixed by "default" in coloured letters, which will alert you to fix this error. You can fix this by typing in game using your op account:
/pex user <username> group add students
Note: I specifically did not make the default group the limited one for students. PEX often messes up plugins by trying to apply permissions to the actions of the plugins (so in this case ScriptCraft might have the same limitations as the students). I have no idea if this is a problem for ScriptCraft, you could test it by moving all the student permissions to default and seeing if ScriptCraft still works.
In Response To Comment: I've modified the config to account for all students needing to be op. By using allowOps: false
this tells PEX that it should apply permissions rules even to ops. With this setting on you will probably need to allow access to all of the ScriptCraft commands, simply add the relevant permission nodes to the relevant groups.
Solution 2:
@at01 > ScriptCraft requires students to be ops. I know that may allow them to circumvent any permissions settings,
There's a new version of scriptcraft with a new classroom module which lets tutors turn on or off scripting for students. That is - it enables students to use ScriptCraft's Javascript interpreter without them being ops. Of course, smart students will quickly figure out how to make themselves ops using javascript.
See https://github.com/walterhiggins/ScriptCraft/blob/master/docs/API-Reference.md#classroom-plugin for more information.