Suggestionentry (Function) — Skript

Addon: Skript · Category: Function

Syntax

suggestionEntry(entry: string, tooltip: component) :: suggestionentry

Description

Creates a command suggestion entry with an optional tooltip component.

Examples

command /home:
	argument <home: string>:
		suggestions:
			loop indices of {homes::%player's uuid%::*}:
				add suggestionEntry(loop-value, mm("<green>%{homes::%player's uuid%::%loop-value%}%")) to suggestions
		trigger:
			if {homes::%player's uuid%::%{_home}%} isn't set:
				send "Home '%{_home}%' doesn't exist."
				stop
			send "Teleporting you to home '%{_home}%'..."
			teleport player to {homes::%player's uuid%::%{_home}%}
	trigger:
		send "Usage: /home <home-name>"

View source