/bed Takaro

threadPage 1 of 1
Monday, October 13, 2025
Avatar for e3617ce9af6d75316d3d8429202aedeabcff86e1baff4480ea9377f0cfa46444
User e3617c
thats what i have

message.txt

TXT2.0 KB

Avatar for 8aa88c3efb234c0cb8e10aeda354934f5962c758666d3ea6bb0c3677e2a3bdba
User 8aa88c
🎯 Answer (Confidence: High)
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:
  1. 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
    BED_TELEPORT_USE
    for this.
  2. 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.
Response generated from 24 search results
Avatar for e3617ce9af6d75316d3d8429202aedeabcff86e1baff4480ea9377f0cfa46444
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"