Repository: PaperMC/Paper
File: paper-api/src/main/java/org/bukkit/entity/HumanEntity.java (Java)

Code before:
    public void setCooldown(ItemStack item, int ticks);

    /**
     * Get the cooldown time in ticks remaining for the specified cooldown group.
     *
     * @param key the cooldown group to check
     * @return the remaining cooldown time in ticks
     * @see UseCooldown#cooldownGroup()
     */
    public int getCooldown(NamespacedKey key);

    /**
     * Set a cooldown on items with the specified cooldown group for a certain amount of ticks.
     * 0 ticks will result in the removal of the cooldown.
     * <p>
     * Cooldowns are used by the server for items such as ender pearls and
     * shields to prevent them from being used repeatedly.
     * <p>
     * Note that cooldowns will not by themselves stop an item from being used
     * for attacking.
     *
     * @param key cooldown group to set the cooldown for
     * @param ticks the amount of ticks to set or 0 to remove
     * @see UseCooldown#cooldownGroup()
     */
    public void setCooldown(NamespacedKey key, int ticks);

    /**
     * Get the sleep ticks of the player. This value may be capped.
     *
     * @return slumber ticks
     */
    public int getSleepTicks();


    /**
     * Gets the Location of the player's bed, null if they have not slept
     * in one. This method will not attempt to validate if the current bed
     * is still valid.
     *
     * @return Bed Location if has slept in one, otherwise null.
     * @see #getPotentialRespawnLocation()
     * @deprecated Misleading name. This method also returns the location of
     * respawn anchors.
     */
    @Nullable
    @Deprecated(since = "1.21.4")
    default Location getPotentialBedLocation() {
        return this.getPotentialRespawnLocation();
    }


Review comment (suggestion):
Can this be an adventure key instead? (the conversation is then in PaperAdventure instead of CraftNamespacedKey)

Code after:
     */
    public void setCooldown(ItemStack item, int ticks);

    /**
     * Get the cooldown time in ticks remaining for the specified cooldown group.
     *
     * @param key the cooldown group to check
     * @return the remaining cooldown time in ticks
     * @see UseCooldown#cooldownGroup()
     */
    public int getCooldown(Key key);

    /**
     * Set a cooldown on items with the specified cooldown group for a certain amount of ticks.
     * 0 ticks will result in the removal of the cooldown.
     * <p>
     * Cooldowns are used by the server for items such as ender pearls and
     * shields to prevent them from being used repeatedly.
     * <p>
     * Note that cooldowns will not by themselves stop an item from being used
     * for attacking.
     *
     * @param key cooldown group to set the cooldown for
     * @param ticks the amount of ticks to set or 0 to remove
     * @see UseCooldown#cooldownGroup()
     */
    public void setCooldown(Key key, int ticks);

    /**
     * Get the sleep ticks of the player. This value may be capped.
     *
     * @return slumber ticks
     */
    public int getSleepTicks();


    /**
     * Gets the Location of the player's bed, null if they have not slept
     * in one. This method will not attempt to validate if the current bed
     * is still valid.
     *
     * @return Bed Location if has slept in one, otherwise null.
     * @see #getPotentialRespawnLocation()
     * @deprecated Misleading name. This method also returns the location of
     * respawn anchors.
     */
    @Nullable
    @Deprecated(since = "1.21.4")
    default Location getPotentialBedLocation() {
        return this.getPotentialRespawnLocation();
    }