MCServer
Importing the class
It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.
Implemented Interfaces
MCServer implements the following interfaces. That means all methods defined in these interfaces are also available in MCServer
- AutoCloseable
Methods
Runs a command, if silent is true, the output is hidden.
Returns The success value of the command, or 0 if an exception occurred.
Note: Some commands’ success value is 0
Return Type: int
Parameter | Type | Description | Optional | DefaultValue |
---|---|---|---|---|
Parameter command | Type string | Description No Description Provided | Optional false | DefaultValue |
Parameter silent | Type boolean | Description No Description Provided | Optional true | DefaultValue false |
let a player send a command, if silent is true, the output is hidden.
Returns The success value of the command, or 0 if an exception occurred.
Note: Some commands’ success value is 0
Return Type: int
Parameter | Type | Description | Optional | DefaultValue |
---|---|---|---|---|
Parameter command | Type string | Description No Description Provided | Optional false | DefaultValue |
Parameter player | Type MCPlayerEntity | Description No Description Provided | Optional false | DefaultValue |
Parameter silent | Type boolean | Description No Description Provided | Optional true | DefaultValue false |
Get a server world instance based on resource location Throws an exception if the world location is unknown
Return Type: MCServerWorld
Parameter | Type | Description |
---|---|---|
Parameter location | Type MCResourceLocation | Description No Description Provided |
Properties
Name | Type | Has Getter | Has Setter | Description |
---|---|---|---|---|
Name worlds | Type Collection<MCServerWorld> | Has Getter true | Has Setter false | Description No Description Provided |