You are viewing an older version of the site. Click here to view
the latest version of this page. (This may be a dead link, if so, try the root page of the docs
here.)
== display_name ==
[[../objects/com.commandhelper.PlayerOfflineException|com.commandhelper.PlayerOfflineException]] |- ! scope="row" | Since | 3.3.2 |- ! scope="row" | Restricted |
Copy Code
The output might be:
Copy Code
The output might be:
Copy Code
The output might be:
Returns the display name of the player.
=== Vital Info ===
{| style="width: 40%;" cellspacing="1" cellpadding="1" border="1" class="wikitable"
|-
! scope="col" width="20%" |
! scope="col" width="80%" |
|-
! scope="row" | Name
| display_name
|-
! scope="row" | Returns
| string
|-
! scope="row" | Usages
| [player]
|-
! scope="row" | Throws
| [[../objects/ms.lang.LengthException|ms.lang.LengthException]][[../objects/com.commandhelper.PlayerOfflineException|com.commandhelper.PlayerOfflineException]] |- ! scope="row" | Since | 3.3.2 |- ! scope="row" | Restricted |
No
|-
! scope="row" | Optimizations
| None
|}
=== Usages ===
display_name([player])=== Examples === ====Example 1==== Demonstrates retrieving the display name for the player calling the function. Given the following code:
display_name()

1 {{function|display_name}}()
:The King====Example 2==== Demonstrates retrieving the display name for the specified player. Given the following code:
display_name('kingbdogz')

1 {{function|display_name}}('kingbdogz')
:The King====Example 3==== Demonstrates attempting to retrieve the display name for a non-existent player. Given the following code:
display_name('does_not_exist')

1 {{function|display_name}}('does_not_exist')
(Throws PlayerOfflineException: The specified player (does_not_exist) is not online)
Find a bug in this page? Edit this page yourself, then submit a pull request. (Note this page is automatically generated from the documentation in the source code.)