/bed Takaro
threadPage 1 of 1
Monday, October 13, 2025
User 8aa88c
🎯 Answer (Confidence: High)
Hello! Creating a permission-based teleport command is a great use of modules.
Hello! Creating a permission-based teleport command is a great use of modules.
The "oops something went wrong" error is a generic server error. For a more specific and helpful message, you can throw a
TakaroUserError from your code. For example: throw new TakaroUserError('You do not have a bed location set.');There are two primary ways to handle permissions for your
/bed command:-
In the Command Configuration (Recommended):
You can define a required permission directly when you create the command. This is the most secure method. If a player lacks the permission, Takaro automatically sends a "permission denied" message, and your command's code is never executed. You can create a custom module permission like
for this.BED_TELEPORT_USE -
Inside the Command's Code:
You can also check for a permission within your function, which allows for more complex logic.// Inside your command function const { pog, player } = data; const hasPermission = checkPermission(pog, 'BED_TELEPORT_USE'); if (!hasPermission) { throw new TakaroUserError('You do not have permission to use /bed.'); } // ... your teleport logic here await player.pm('Teleporting you to your bed!');
By creating a custom permission and assigning it to roles, you can control exactly who has access to your command.
Sources:
• Takaro Documentation: Writing Takaro Modules | Takaro (3 sections)
• Takaro Documentation: Modules | Takaro
• Takaro Documentation: Roles and permissions | Takaro
• Takaro Documentation: Writing Takaro Modules | Takaro (3 sections)
• Takaro Documentation: Modules | Takaro
• Takaro Documentation: Roles and permissions | Takaro
Response generated from 24 search results
User e3617c
Im trying to make a /bed teleport with permission, how can i achieve that? i have a code but im just getting an error if i try to use /bed "oops something went wrong"