问题标签 [minecraft-fabric]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
minecraft - 尝试在 VPS 上运行 Fabric Minecraft 服务器时出现错误
错误是:
确切的服务器可以在我的 PC 上运行,但由于某种原因不能在我的 VPS 上运行。提前致谢!
minecraft-fabric - MC Fabric Mod Get world name
I'm trying to get the world name, so in end result I can store relevant data for my mod in the correct folder. In clients, the file structure is /saves/worldName. For the servers it looks like its just /worldName .
I know servers will load the world based on what is in server.properties . But reading that seems sloppy, and I do not know how to read what world is loaded for singleplayer.
What methods can I use to get a world name?
java - Is there a way to get a player's respawn coordinates with a PlayerEntity object (Fabricmc)
I made a use override on the Block class
is there a way to use the playerEntity variable to get the player's respawn coorindates?
java - 如何使用fabric 1.16.5 mod获得开放库存的标题
我正在使用fabric 1.16.5 为我的世界开发客户端mod,并且我正在尝试获取开放库存的标题(参见下面的示例)。
在示例中,标题为“Sell Items - 0”(带有表情符号)。
我试过的:
MinecraftClient.getInstance().player.inventory.getName()
-> 返回“库存”MinecraftClient.getInstance().player.inventory.getDisplayName()
-> 返回“库存”MinecraftClient.getInstance().player.inventory.getCustomName()
-> 返回空值
由于结果,我猜测库存正在返回底部库存,即生存库存。如何获取服务器提供的自定义库存(顶级库存)。
感谢所有帮助。
minecraft-fabric - How do I make the Scoreboard on the side not be visible when the Debug HUD is open?
I'm working on a 1.16.5 Minecraft client-side mod and I am trying to get the scoreboard to be invisible when the Debug HUD
is visible. I have a basic mixin to the scoreboard's rendering function but I need to be able to check for whether the DebugHud
is visible or not.
Code:
networking - 如何创建欺骗资源包的 Minecraft 结构模型
我正在尝试创建一个 Minecraft 结构模块(或 jarmod),当发送服务器资源包时,它会发回一个数据包,确认它已加载资源包,而实际上并没有。这旨在用于绕过某些服务器需要使用自定义纹理包的方式,该纹理包必须每次加载。Minecraft 控制台客户端(代码)中使用了类似的系统,它甚至不加载纹理。有没有办法做到这一点?我无法理解Fabric Networking Tutorial,任何代码或建议似乎都与我正在尝试做的事情无关。另外,我不使用java。有没有更了解这个主题的人可以提供帮助?
java - Fabric:无法解析配置“:classpath”的所有工件
我尝试从 Minecraft Fabric 示例模式大师设置我的 gradle 项目,但是当我打开项目时,会出现此错误
“无法解析配置 ':classpath' 的所有工件”
我使用哪个版本并不重要。
这是长错误的一部分
配置根项目“fabric-example-mod-master”时出现问题。无法解析配置“:classpath”的所有工件。无法解析 commons-io:commons-io:2.8.0。要求:项目:> fabric-loom:fabric-loom.gradle.plugin:0.7-SNAPSHOT:20210908.104732-33 > net.fabricmc:fabric-loom:0.7-SNAPSHOT:20210908.104734-33 > 无法解析 commons-io:commons -io:2.8.0。> 无法获取资源“https://plugins.gradle.org/m2/commons-io/commons-io/2.8.0/commons-io-2.8.0.pom”。> 无法获取“https://jcenter.bintray.com/commons-io/commons-io/2.8.0/commons-io-2.8.0.pom”。从服务器收到状态代码 403:禁止无法解析 org.zeroturnaround:zt-zip:1.14。要求:项目:> fabric-loom:fabric-loom.gradle.plugin:0.7-SNAPSHOT:20210908.104732-33 > net.fabricmc: fabric-loom:0.7-SNAPSHOT:20210908.104734-33 > 无法解析 org.zeroturnaround:zt-zip:1.14。> 无法获取资源“https://plugins.gradle.org/m2/org/zeroturnaround/zt-zip/1.14/zt-zip-1.14.pom”。> 无法获取“https://jcenter.bintray.com/org/zeroturnaround/zt-zip/1.14/zt-zip-1.14.pom”。从服务器收到状态代码 403:禁止无法解析 com.google.code.gson:gson:2.8.6。要求:项目:> fabric-loom:fabric-loom.gradle.plugin:0.7-SNAPSHOT:20210908.104732-33 > net.fabricmc:fabric-loom:0.7-SNAPSHOT:20210908.104734-33 > 无法解析 com.google.code .gson:gson:2.8.6。> 无法获取资源“https://plugins.gradle.org/m2/com/google/code/gson/gson/2.8.6/gson-2.8.6.pom”。> 无法获取“https://jcenter.bintray.com/com/google/code/gson/gson/2.8.6/gson-2.8.6.pom”。从服务器收到状态码 403:禁止无法解析 com.google.guava:guava:30.1-jre。要求:项目:> fabric-loom:fabric-loom.gradle.plugin:0.7-SNAPSHOT:20210908.104732-33 > net.fabricmc:fabric-loom:0.7-SNAPSHOT:20210908.104734-33 > 无法解析 com.google.guava :番石榴:30.1-jre。> 无法获取资源“https://plugins.gradle.org/m2/com/google/guava/guava/30.1-jre/guava-30.1-jre.pom”。> 无法获取“https://jcenter.bintray.com/com/google/guava/guava/30.1-jre/guava-30.1-jre.pom”。从服务器收到状态代码 403:禁止无法解析 org.ow2.asm:asm:9.1。要求:fabric-loom:0.7-SNAPSHOT:20210908.104734-33 > 无法解析 com.google.guava:guava:30.1-jre。> 无法获取资源“https://plugins.gradle.org/m2/com/google/guava/guava/30.1-jre/guava-30.1-jre.pom”。> 无法获取“https://jcenter.bintray.com/com/google/guava/guava/30.1-jre/guava-30.1-jre.pom”。从服务器收到状态代码 403:禁止无法解析 org.ow2.asm:asm:9.1。要求:fabric-loom:0.7-SNAPSHOT:20210908.104734-33 > 无法解析 com.google.guava:guava:30.1-jre。> 无法获取资源“https://plugins.gradle.org/m2/com/google/guava/guava/30.1-jre/guava-30.1-jre.pom”。> 无法获取“https://jcenter.bintray.com/com/google/guava/guava/30.1-jre/guava-30.1-jre.pom”。从服务器收到状态代码 403:禁止无法解析 org.ow2.asm:asm:9.1。要求:
构建.gradle
gradle - 为什么在运行控制台命令时 Gradle 没有正确检测到我的 JAVA_HOME
最近,我一直想回到 Minecraft 改装,所以我选择了 Fabric 进行改装。我查看了教程页面,专门用于为 Fabric 创建和生成源代码。但是,在运行gradlew eclipse
命令时,Gradle 会吐出错误消息,说我使用的是 Java 的过时版本,Java 8,但需要 Java 16 或更高版本。但我正在使用 Java 16,它在我的JAVA_HOME
路径中。
这是完整的错误:
在提出问题之前我已经进行了研究,人们只是说“更新 gradle”或“更新 JDK/JRE”,但我的都更新了,如下所示:
人们还说要禁用守护程序,或者有时在他们等待时,Gradle 会再次修复自己,但是,org.gradle.daemon=false
命令并--no-daemon
在说gradlew eclipse
. 另外,我正在尝试 Forge 的示例并且 Gradle 工作正常,那么我该如何解决这个问题呢?
java - Infer dependencies in Gradle subproject from its parent project
I currently have 3 subprojects in my Gradle project, structured like so:
Project A has dependency on Lib A and Common Src, and Project B has dependency on Lib B and Common Src. Lib A and Lib B contain different implementations of the same classes.
My plan for Common Src project was to house all of the utility classes, necessarily depending on both Lib A and Lib B.
Is there a way to set this up, and how should my gradle project look like?
Things that I've tried:
- I've tried to remove Common Src as a subproject and just include it in the sourceSets of Project A and Project B. However, IntelliJ seems to mark Common Src as sources root of Project A, and even though build-through-gradle works, I cannot get IntelliJ to recognize that Project B also has sources root in Common Src.
- Add both Lib A and Lib B to dependency of Common Src, but obviously that doesn't work.
The background:
I've created a Minecraft mod compatible with both Forge (Project A) and Fabric (Project B) modloaders. I have utility classes in both projects that have the same source code but need to be compiled twice, each time with a different dependency. I don't want to have to write the code twice each time I want to change something in the Utility classes.
java - getOutlineShape 已弃用,是否有另一种方法来更改命中框?
我正在制作一个不占用 Fabric 1.18 中的完整块的块。
我已经按照 Fabric wiki 上的建议尝试了以下代码。
它确实有效,只是在 IDE 和控制台中显示了已弃用的警告。
还有什么我应该用的吗?