Skip to content

Player Shop Expiration

blablubbabc edited this page Sep 8, 2026 · 1 revision

Player shops can be configured to expire after a certain duration. This is useful to keep a server free of abandoned shops, and, in combination with hireable player shops, to rent out shops for a limited time.

Configuration

See Configuration for details. Relevant settings:

  • player-shop-expiration-days (default: 0): After how many days normally owned player shops are deleted. 0 to disable.
  • hired-player-shop-expiration-days (default: 0): After how many days hired shops revert to their for-hire state. 0 to disable.
  • notify-shop-members-about-expiration (default: true): Whether to remind shop members about approaching expirations.
  • player-shop-expiration-notification-thresholds (default: "10080,4320,1440,720,60,10"): The reminder thresholds in minutes before the expiration. Default: 7 days, 3 days, 1 day, 12 hours, 1 hour, and 10 minutes before expiration.

When the expiration starts

The expiration is measured from when the current owner acquired the shop, i.e. when:

  • The shop is created.
  • The shop is hired, including when its current owner hires it again.
  • The shop is transferred via /shopkeeper transfer.
  • A plugin cancels the expiration, or resets it via the API.

Notifications

If notify-shop-members-about-expiration is enabled (default: true), the shop owner and the other shop members are reminded as the expiration approaches, so that they have a chance to clear their shop containers in time.

The reminders are sent at the thresholds configured via player-shop-expiration-notification-thresholds, a comma-separated list of minutes before the expiration. The default 10080,4320,1440,720,60,10 corresponds to 7 days, 3 days, 1 day, 12 hours, 1 hour, and 10 minutes before the expiration. Each player is reminded at most once per shop and threshold, and only while they are online.

Regardless of this setting, players are always informed:

  • When they create, hire, or are transferred a shop that expires.
  • When one of their shops expires while they are online. Shops that expire while a player is offline are not reported to them later.

Checking when shops expire

  • /shopkeeper expiration [player] lists the next few shops of a player that are about to expire. Without the player argument it lists your own shops (permission shopkeeper.expiration.own, default: true). A player can be specified by name or unique id, which also works for offline players (permission shopkeeper.expiration.others, default: op).
  • /shopkeeper list shows the remaining time for each listed shop.

Accuracy

The plugin checks for expired shops and pending notifications roughly every 5 minutes, starting 5 minutes after the plugin enabled. The expiration durations and the notification thresholds are therefore only estimates, and the actual expiration can be delayed by a few minutes. Notification thresholds below the check interval may be skipped entirely.

This also means that shops listed by /shopkeeper expiration may already have reached their expiration time without having been expired yet.

Additional notes

  • Be careful when reducing a duration on a running server. Shops that are already older than the new duration expire within the next few minutes, without any prior expiration notifications.
  • When an expired shop is deleted, its containers and their contents remain in the world, but they are no longer protected by the plugin.
  • Every expiration is written to the server log.
  • Shops that were already hired before Shopkeepers v2.28.0 did not retain a hire cost item. They are therefore treated like normally owned player shops and expire according to player-shop-expiration-days.
  • For shops that already existed before Shopkeepers v2.28.0, the plugin does not know when their current owner acquired them. Their expiration starts when they are loaded for the first time after the update.

API

  • PlayerShopkeeper#getOwnedSince(), #getExpiration(), #resetExpiration(), and #expire().
  • PlayerShopkeeperExpireEvent: Called whenever a player shop is about to expire. Cancelling it prevents the expiration and automatically resets its expiration duration.

Clone this wiki locally