上記の %LOCALAPPDATA%\Packages\Microsoft.4297127D64EC6_8wekyb3d8bbwe\LocalCache\Local\Microsoft\WritablePackageRoot\runtime\java-runtime-alpha\windows-x64\java-runtime-alpha\bin に jar を移動して
java -jar xxx.jar
すれば起動できます
ダウンロードフォルダにおいて上記の java.exe を指定して実行してもクラスパスが見つからずにエラーになるので jar を移動してから実行しましょう
spotless {
format 'misc', {
// define the files to apply `misc` to
target '*.gradle', '.gitattributes', '.gitignore'
// define the steps to apply to those files
trimTrailingWhitespace()
leadingTabsToSpaces()
endWithNewline()
}
java {
// don't need to set target, it is inferred from java
// apply a specific flavor of google-java-format
googleJavaFormat('1.17.0').aosp().reflowLongStrings().skipJavadocFormatting()
// fix formatting of type annotations
formatAnnotations()
// make sure every file has the following copyright header.
// optionally, Spotless can set copyright years by digging
// through git history (see "license" section below)
licenseHeader '/* (C)$YEAR */'
}
}
今回は「クライアント mod」を導入します
mod にはクライアント mod の場合はサーバ側にもクライアント側にも mod を導入する必要があるので注意してください
サーバ側は ./data/mods/examplemod-1.0.0.jar に配置すれば docker compose up -d 時に自動でコンテナ側に mod が配置され有効になります
サーバ側のログを確認して mod のログが流れていれば OK です
あとはクライアント側の Minecraft にも examplemod-1.0.0.jar を導入する必要があります
forge をインストールし mod 配置用のパスに jar を配置すれば OK です
macOS の Java 版 Minecraft に forge MOD をインストールする場合に jar のダブルクリックからだと起動しないことがあります
その場合はシステム設定のプライバシーとセキュリティからブロックされている jar を開けば OK です
クライアント側の mod のパスは /Users/user01/Library/Application Support/minecraft/mods がデフォルトです
diff --git a/gradle.properties b/gradle.properties
index 6c23fa8..810b037 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -7,13 +7,13 @@ org.gradle.daemon=false
## Environment Properties
# The Minecraft version must agree with the Forge version to get a valid artifact
-minecraft_version=1.20.6
+minecraft_version=1.21.4
# The Minecraft version range can use any release version of Minecraft as bounds.
# Snapshots, pre-releases, and release candidates are not guaranteed to sort properly
# as they do not follow standard versioning conventions.
-minecraft_version_range=[1.20.6,1.21)
+minecraft_version_range=[1.21.4,1.22)
# The Forge version must agree with the Minecraft version to get a valid artifact
-forge_version=50.1.0
+forge_version=54.0.18
# The Forge version range can use any version of Forge as bounds or match the loader version range
forge_version_range=[0,)
# The loader version range can only use the major version of Forge/FML as bounds
@@ -35,7 +35,7 @@ loader_version_range=[0,)
mapping_channel=official
# The mapping version to query from the mapping channel.
# This must match the format required by the mapping channel.
-mapping_version=1.20.6
+mapping_version=1.21.4
// 報酬を降らせる処理privatevoidspawnReward(Player player, Level level){// プレイヤーの位置double x = player.getX();double y = player.getY()+20;// プレイヤーの上空20ブロックdouble z = player.getZ();for(int i =0; i <10;++i){// 報酬アイテム(例: ダイヤモンド)
ItemEntity reward =newItemEntity(level, x, y, z, Items.DIAMOND.getDefaultInstance());
level.addFreshEntity(reward);}}