-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Description
Placeholders allow messages to access and include information that is not specifically provided by the developer as an argument to the function. For example, if a command is run by a player placeholders can be used to get information like the player's world or position through properties. These can then be combined as needed to result in a much more power placeholder system than existing methods.
Examples
${@player.world}- Retrieves the argument
playerand gets their world (printing the name)
- Retrieves the argument
${#player.position.x}- Retrieves the player from the context and gets the x coordinate of their position
${#date}- Retrieves the current date from the context, formatted as
yyyy-mm-dd
- Retrieves the current date from the context, formatted as
Motivation
Placeholders are a powerful way to customize messages and open up a lot of possibilities for the user. A system like this is necessary to maintain good performance with so many options, and makes it easy for developers to support such behavior. If it were possible to handle placeholders with arguments, then grammatical cases like a/an and singular/plural could be handled as well.