├── .github └── workflows │ └── gradle.yml ├── .gitignore ├── README.md ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── plugin.json └── src └── example └── ExamplePlugin.java /.github/workflows/gradle.yml: -------------------------------------------------------------------------------- 1 | name: Java CI 2 | 3 | on: [push] 4 | 5 | jobs: 6 | buildJar: 7 | runs-on: ubuntu-latest 8 | 9 | steps: 10 | - uses: actions/checkout@v1 11 | - name: Set up JDK 17 12 | uses: actions/setup-java@v1 13 | with: 14 | java-version: 17 15 | - name: Build plugin jar 16 | run: ./gradlew jar 17 | - name: Upload built jar file 18 | uses: actions/upload-artifact@v4 19 | with: 20 | name: ${{ github.event.repository.name }} 21 | path: build/libs/${{ github.event.repository.name }}.jar 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | logs/ 2 | /core/assets/mindustry-saves/ 3 | /core/assets/mindustry-maps/ 4 | /core/assets/bundles/output/ 5 | /core/assets/.gifimages/ 6 | /deploy/ 7 | /desktop/packr-out/ 8 | /desktop/packr-export/ 9 | /desktop/mindustry-saves/ 10 | /desktop/mindustry-maps/ 11 | /desktop/gifexport/ 12 | /core/lib/ 13 | /ios/assets/ 14 | /core/assets-raw/sprites/generated/ 15 | /core/assets-raw/sprites_out/ 16 | /annotations/build/ 17 | /annotations/out/ 18 | /net/build/ 19 | /tools/build/ 20 | /tests/build/ 21 | /server/build/ 22 | /test_files/ 23 | /annotations/build/ 24 | /desktop-sdl/build/ 25 | desktop-sdl/build/ 26 | /android/assets/mindustry-maps/ 27 | /android/assets/mindustry-saves/ 28 | /core/assets/gifexport/ 29 | /core/assets/version.properties 30 | /core/assets/locales 31 | /ios/src/io/anuke/mindustry/gen/ 32 | /core/src/io/anuke/mindustry/gen/ 33 | ios/robovm.properties 34 | packr-out/ 35 | config/ 36 | *.gif 37 | 38 | version.properties 39 | 40 | .attach_* 41 | ## Java 42 | 43 | *.class 44 | *.war 45 | *.ear 46 | hs_err_pid* 47 | crash-report-* 48 | 49 | ## Robovm 50 | /ios/robovm-build/ 51 | 52 | ## GWT 53 | /html/war/ 54 | /html/gwt-unitCache/ 55 | .apt_generated/ 56 | .gwt/ 57 | gwt-unitCache/ 58 | www-test/ 59 | .gwt-tmp/ 60 | 61 | ## Android Studio and Intellij and Android in general 62 | /android/libs/armeabi/ 63 | /android/libs/armeabi-v7a/ 64 | /android/libs/arm64-v8a/ 65 | /android/libs/x86/ 66 | /android/libs/x86_64/ 67 | /android/gen/ 68 | .idea/ 69 | *.ipr 70 | *.iws 71 | *.iml 72 | /android/out/ 73 | com_crashlytics_export_strings.xml 74 | 75 | ## Eclipse 76 | 77 | .classpath 78 | .project 79 | .metadata/ 80 | /android/bin/ 81 | /core/bin/ 82 | /desktop/bin/ 83 | /html/bin/ 84 | /ios/bin/ 85 | /ios-moe/bin/ 86 | *.tmp 87 | *.bak 88 | *.swp 89 | *~.nib 90 | .settings/ 91 | .loadpath 92 | .externalToolBuilders/ 93 | *.launch 94 | 95 | ## NetBeans 96 | 97 | /nbproject/private/ 98 | /android/nbproject/private/ 99 | /core/nbproject/private/ 100 | /desktop/nbproject/private/ 101 | /html/nbproject/private/ 102 | /ios/nbproject/private/ 103 | /ios-moe/nbproject/private/ 104 | 105 | /build/ 106 | /android/build/ 107 | /core/build/ 108 | /desktop/build/ 109 | /html/build/ 110 | /ios/build/ 111 | /ios-moe/build/ 112 | 113 | /nbbuild/ 114 | /android/nbbuild/ 115 | /core/nbbuild/ 116 | /desktop/nbbuild/ 117 | /html/nbbuild/ 118 | /ios/nbbuild/ 119 | /ios-moe/nbbuild/ 120 | 121 | /dist/ 122 | /android/dist/ 123 | /core/dist/ 124 | /desktop/dist/ 125 | /html/dist/ 126 | /ios/dist/ 127 | /ios-moe/dist/ 128 | 129 | /nbdist/ 130 | /android/nbdist/ 131 | /core/nbdist/ 132 | /desktop/nbdist/ 133 | /html/nbdist/ 134 | /ios/nbdist/ 135 | /ios-moe/nbdist/ 136 | 137 | nbactions.xml 138 | nb-configuration.xml 139 | 140 | ## Gradle 141 | 142 | /local.properties 143 | .gradle/ 144 | gradle-app.setting 145 | /build/ 146 | /android/build/ 147 | /core/build/ 148 | /desktop/build/ 149 | /html/build/ 150 | /ios/build/ 151 | /ios-moe/build/ 152 | 153 | ## OS Specific 154 | .DS_Store 155 | Thumbs.db 156 | android/libs/ 157 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### Setup 2 | 3 | Clone this repository first. 4 | To edit the plugin display name and other data, take a look at `plugin.json`. 5 | Edit the name of the project itself by going into `settings.gradle`. 6 | 7 | ### Basic Usage 8 | 9 | See `src/example/ExamplePlugin.java` for some basic commands and event handlers. 10 | Every main plugin class must extend `Plugin`. Make sure that `plugin.json` points to the correct main plugin class. 11 | 12 | Please note that the plugin system is in beta, and as such is subject to changes. 13 | 14 | ### Building a Jar 15 | 16 | `gradlew jar` / `./gradlew jar` 17 | 18 | Output jar should be in `build/libs`. 19 | 20 | 21 | ### Installing 22 | 23 | Simply place the output jar from the step above in your server's `config/mods` directory and restart the server. 24 | List your currently installed plugins/mods by running the `mods` command. 25 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "java" 2 | 3 | version '1.0' 4 | 5 | sourceCompatibility = JavaVersion.VERSION_16 6 | 7 | sourceSets.main.java.srcDirs = ["src"] 8 | 9 | compileJava.options.encoding = "UTF-8" 10 | compileTestJava.options.encoding = "UTF-8" 11 | 12 | repositories{ 13 | mavenCentral() 14 | maven{ url "https://raw.githubusercontent.com/Zelaux/MindustryRepo/master/repository" } 15 | maven{ url 'https://www.jitpack.io' } 16 | } 17 | 18 | ext{ 19 | //the build number that this plugin is made for 20 | mindustryVersion = 'v145' 21 | jabelVersion = "93fde537c7" 22 | } 23 | 24 | //java 8 backwards compatibility flag 25 | allprojects{ 26 | tasks.withType(JavaCompile){ 27 | options.compilerArgs.addAll(['--release', '8']) 28 | } 29 | } 30 | 31 | dependencies{ 32 | compileOnly "com.github.Anuken.Arc:arc-core:$mindustryVersion" 33 | compileOnly "com.github.Anuken.Mindustry:core:$mindustryVersion" 34 | annotationProcessor "com.github.Anuken:jabel:$jabelVersion" 35 | } 36 | 37 | jar{ 38 | archiveFileName = "${project.archivesBaseName}.jar" 39 | from{ 40 | configurations.runtimeClasspath.collect{it.isDirectory() ? it : zipTree(it)} 41 | } 42 | 43 | from(rootDir){ 44 | include "plugin.json" 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=--illegal-access=permit \ 2 | --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \ 3 | --add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED \ 4 | --add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED \ 5 | --add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED \ 6 | --add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \ 7 | --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \ 8 | --add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \ 9 | --add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \ 10 | --add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED \ 11 | --add-exports=jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED \ 12 | --add-exports=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED \ 13 | --add-exports=java.base/sun.reflect.annotation=ALL-UNNAMED 14 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anuken/MindustryPluginTemplate/dc0b8e369767dc0792ae89c6dc9fc3acf7096120/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn () { 37 | echo "$*" 38 | } 39 | 40 | die () { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Escape application args 158 | save () { 159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 160 | echo " " 161 | } 162 | APP_ARGS=$(save "$@") 163 | 164 | # Collect all arguments for the java command, following the shell quoting and substitution rules 165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 166 | 167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 169 | cd "$(dirname "$0")" 170 | fi 171 | 172 | exec "$JAVACMD" "$@" 173 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ExamplePlugin", 3 | "author": "Anuke", 4 | "main": "example.ExamplePlugin", 5 | "description": "A plugin to demonstrate some basic features.", 6 | "version": 1.0 7 | } 8 | -------------------------------------------------------------------------------- /src/example/ExamplePlugin.java: -------------------------------------------------------------------------------- 1 | package example; 2 | 3 | import arc.*; 4 | import arc.util.*; 5 | import mindustry.*; 6 | import mindustry.content.*; 7 | import mindustry.game.EventType.*; 8 | import mindustry.gen.*; 9 | import mindustry.mod.*; 10 | import mindustry.net.Administration.*; 11 | import mindustry.world.blocks.storage.*; 12 | 13 | public class ExamplePlugin extends Plugin{ 14 | 15 | //called when game initializes 16 | @Override 17 | public void init(){ 18 | //listen for a block selection event 19 | Events.on(BuildSelectEvent.class, event -> { 20 | if(!event.breaking && event.builder != null && event.builder.buildPlan() != null && event.builder.buildPlan().block == Blocks.thoriumReactor && event.builder.isPlayer()){ 21 | //player is the unit controller 22 | Player player = event.builder.getPlayer(); 23 | 24 | //send a message to everyone saying that this player has begun building a reactor 25 | Call.sendMessage("[scarlet]ALERT![] " + player.name + " has begun building a reactor at " + event.tile.x + ", " + event.tile.y); 26 | } 27 | }); 28 | 29 | //add a chat filter that changes the contents of all messages 30 | //in this case, all instances of "heck" are censored 31 | Vars.netServer.admins.addChatFilter((player, text) -> text.replace("heck", "h*ck")); 32 | 33 | //add an action filter for preventing players from doing certain things 34 | Vars.netServer.admins.addActionFilter(action -> { 35 | //random example: prevent blast compound depositing 36 | if(action.type == ActionType.depositItem && action.item == Items.blastCompound && action.tile.block() instanceof CoreBlock){ 37 | action.player.sendMessage("Example action filter: Prevents players from depositing blast compound into the core."); 38 | return false; 39 | } 40 | return true; 41 | }); 42 | } 43 | 44 | //register commands that run on the server 45 | @Override 46 | public void registerServerCommands(CommandHandler handler){ 47 | handler.register("reactors", "List all thorium reactors in the map.", args -> { 48 | for(int x = 0; x < Vars.world.width(); x++){ 49 | for(int y = 0; y < Vars.world.height(); y++){ 50 | //loop through and log all found reactors 51 | //make sure to only log reactor centers 52 | if(Vars.world.tile(x, y).block() == Blocks.thoriumReactor && Vars.world.tile(x, y).isCenter()){ 53 | Log.info("Reactor at @, @", x, y); 54 | } 55 | } 56 | } 57 | }); 58 | } 59 | 60 | //register commands that player can invoke in-game 61 | @Override 62 | public void registerClientCommands(CommandHandler handler){ 63 | 64 | //register a simple reply command 65 | handler.register("reply", "", "A simple ping command that echoes a player's text.", (args, player) -> { 66 | player.sendMessage("You said: [accent] " + args[0]); 67 | }); 68 | 69 | //register a whisper command which can be used to send other players messages 70 | handler.register("whisper", " ", "Whisper text to another player.", (args, player) -> { 71 | //find player by name 72 | Player other = Groups.player.find(p -> p.name.equalsIgnoreCase(args[0])); 73 | 74 | //give error message with scarlet-colored text if player isn't found 75 | if(other == null){ 76 | player.sendMessage("[scarlet]No player by that name found!"); 77 | return; 78 | } 79 | 80 | //send the other player a message, using [lightgray] for gray text color and [] to reset color 81 | other.sendMessage("[lightgray](whisper) " + player.name + ":[] " + args[1]); 82 | }); 83 | } 84 | } 85 | --------------------------------------------------------------------------------