# Temporary Bans

If you want to ban a player temporarily, you can specify the duration of the ban.

### Step 1: Use the `/tempban` Command

<div class="cl-preview-section" id="bkmrk-open-the-chat-or-con">1. **Open the Chat or Console**  
    Run the following command from either chat or the console.
2. **Type the `/tempban` Command**  
    The format for a temporary ban is:
    
    ```
    /tempban <player> <duration> [reason]  
    
    
    ```
    
    
    - `<player>` is the player’s username.
    - `<duration>` is the amount of time for the ban (e.g., `30m` for 30 minutes, `1d` for one day, `2w` for two weeks).
    - `[reason]` is optional.

</div>### Example:

```
/tempban Notch 1d Breaking server rules  


```

This will ban **Notch** for 1 day with the reason “Breaking server rules.”