Everything posted by warjort
-
Unknown crash turning off PC entirely
There's like zero chance this is minecraft/forge issue. It's a java program that run's in a java virtual machine. It doesn't even get to talk to the operating system directly, let alone the hardware. minecraft/forge -> java -> operating system -> hardware You should look at your operating system logs to see if it recorded something, e.g. windows event viewer Otherwise, your most likely causes are; An interruption or spike in your power supply Faulty hardware (overheating is only one example of this). But PC support is not really a subject for these forums. ๐
-
ban a player who has reached the time limit played
I don't think you want to reset the vanilla stat. Some other mod might be using for some other processing. You should make your own stat, something like: // Registration public static final DeferredRegister<ResourceLocation> STATS = DeferredRegister.create(Registry.CUSTOM_STAT_REGISTRY, MODID); public static final RegistryObject<ResourceLocation> MY_PLAY_TIME = STATS.register("my_play_time", () -> new ResourceLocation(MODID, "my_play_time")); @SubscribeEvent public static void tickHandler(TickEvent.PlayerTickEvent event) { if (event.side.isServer() && event.phase == Phase.END) { ServerPlayer player = (ServerPlayer) event.player; ServerStatsCounter stats = player.getStats(); // Increment the stat Stat<ResourceLocation> stat = Stats.CUSTOM.get(MY_PLAY_TIME.get()); player.awardStat(stat); // Check the stat int playTime = stats.getValue(stat); if (playTime >= 200) { player.resetStat(stat); // Your ban code here } } } You obviously need to register the STATS registry like other DeferredRegisters. And you will want to add something to your language file so the stat has a proper description in the stats screen. That way the players can see how long they have until they get banned. ๐
-
How to remove the sight (cross in the center of the screen)
@Mod.EventBusSubscriber(modid = MODID, value = Dist.CLIENT) public class ClientEvents { @SubscribeEvent public static void renderCrossHair(RenderGuiOverlayEvent.Pre event) { if (VanillaGuiOverlay.CROSSHAIR.type() == event.getOverlay()) { if (Minecraft.getInstance().player.getItemInHand(InteractionHand.OFF_HAND).is(Items.DIAMOND)) { event.setCanceled(true); } } } } Now put a diamond in your offhand/shield slot. ๐
-
ban a player who has reached the time limit played
You can use one of those player stats I suggested. Or you can attach a player capability that holds the data. Look at "DataStorage" here: https://forge.gemwire.uk/wiki/Main_Page
-
ban a player who has reached the time limit played
The most important part of that code for your question is "timerToKick" and yet you don't show how it is defined? I can deduce it must be a static field somewhere which means every player is updating/checking the same timer. Also, I guess you never tested this code on a client? It would crash on that unchecked cast to a ServerPlayer.
-
How to remove the sight (cross in the center of the screen)
Subscribe to RenderGuiOverlayEvent.Pre and event.setCancel(true) for whatever conditions you want. The overlay you want is: VanillaGuiOverlay.CROSSHAIR
-
ban a player who has reached the time limit played
Show what you tried. "It doesn't work" type statements are useless. We are not psychic. ๐ I don't know if these are useful to you, but every player has a number of Stats that keep track of durations (in ticks). e.g. Stats.PLAY_TIME or Stats.TIME_SINCE_DEATH You could also make your own Stat using a PlayerTickEvent if these are not what you want.
-
1.19.2
Mod File: /C:/Users/compu/AppData/Roaming/.minecraft/mods/AdditionalEnchantedMiner-1.19.2-19.6.jar Failure message: QuarryPlus has class loading errors java.lang.reflect.InvocationTargetException: null Mod Version: 19.6 Mod Issue URL: https://github.com/Kotori316/QuarryPlus/issues Exception message: java.lang.IncompatibleClassChangeError: Method 'net.minecraftforge.eventbus.api.BusBuilder net.minecraftforge.eventbus.api.BusBuilder.builder()' must be Methodref constant If you have the latest versions, you should contact the mod author using that link.
-
Attempting to launch the Minecraft 1.19.2 client with forge from Intellij pops up with 9 errors.
Why would you need that? You just to need make your repository public in the "change visibility" settings. Then post a link to it.
-
create mod error upon world load
Caused by: java.lang.NoClassDefFoundError: com/simibubi/create/repack/registrate/Registrate at com.github.talrey.createdeco.CreateDecoMod.<init>(CreateDecoMod.java:53) ~[createdeco-1.2.9-1.18.2.jar%2382!/:1.2.9-1.18.2] ... 14 more This is an issue with createdeco. It's probably not up-to-date with the latest changes to create. https://github.com/talrey/CreateDeco/issues/36 https://github.com/Creators-of-Create/Create/issues/3645
-
1.18.2 All the Mods 7 Error
For curseforge you need to enable the forge debug.log in the minecraft settings. It will then be in the logs subfolder of the profile folder.
-
Porting a fabric mod to forge
That's a misrepresentation and I think you know it. ๐ Isn't having fun the whole point of writing mods? I agree they are 2 different philosophies (which you prefer is a matter of taste): Forge: A one-stop shop for everything you need for modding, concentrating on mod compatibility/correctness Fabric: An a-la-carte (don't pay for what you don't need) approach where the fabric-api concentrates on common use cases and the ecosystem provides more specialised apis, and don't expect it to hold your hand when it comes to writing correct mods Forge itself has something of the a-la-carte with mods like curios, "waila", jei, patchoulli, terrablender, etc. having specialised apis not provided by forge. It's really a matter of where the 2 draw the line. I agree the difference in philosophy makes porting mods more difficult. For the original poster, Litematica are already working on it (but they have been for a while): https://github.com/maruohon/litematica/issues/234
-
1.18.2 All the Mods 7 Error
java.lang.ClassCastException: class net.minecraft.client.renderer.CubeMap cannot be cast to class shadows.packmenu.panorama.VariedRenderSkyboxCube (net.minecraft.client.renderer.CubeMap is in module [email protected] of loader 'TRANSFORMER' @1ad1be5d; shadows.packmenu.panorama.VariedRenderSkyboxCube is in module [email protected] of loader 'TRANSFORMER' @1ad1be5d) at shadows.packmenu.PackMenuClient.lambda$load$0(PackMenuClient.java:140) ~[PackMenu-1.18.2-4.1.1.jar%23274!/:4.1.1] {re:classloading} The actual error is in PackMenu. But given the error message, it is likely an earlier problem not shown in the crash report. Post a link to your logs/debug.log
-
Crash when using Goat Horn (Forge 1.19.2-43.1.1)
This was fixed in 43.1.2: https://github.com/MinecraftForge/MinecraftForge/issues/8985 https://maven.minecraftforge.net/net/minecraftforge/forge/1.19.2-43.1.2/forge-1.19.2-43.1.2-changelog.txt
-
Create Curios (createcurios) encountered an error during the sided_setup event phase java.lang.NoSuchFieldError: GOGGLES
-- MOD createcurios -- Details: Mod File: /C:/Users/A0001/curseforge/minecraft/Instances/Betta Minecraft/mods/Create-Curios-1.18.2-v1.0.0.jar Failure message: Create Curios (createcurios) encountered an error during the sided_setup event phase java.lang.NoSuchFieldError: GOGGLES Mod Version: 1.0.0 Mod Issue URL: NOT PROVIDED Exception message: java.lang.NoSuchFieldError: GOGGLES Stacktrace: at com.luis.createcurios.goggle.Render.register(Render.java:14) ~[Create-Curios-1.18.2-v1.0.0.jar%23110!/:1.0] {re:classloading,pl:runtimedistcleaner:A} at com.luis.createcurios.goggle.Overlay.onClientSetup(Overlay.java:32) ~[Create-Curios-1.18.2-v1.0.0.jar%23110!/:1.0] {re:classloading} It's an issue with createcurios, it's probably not up-to-date with the recent changes in create, contact the mod author.
-
Spawning Item in world
I deduce you didn't read what I suggested. ๐
-
Spawning Item in world
You are going to need spend time looking at that wiki. You will just annoy people if you keep asking questions about stuff that is answered there. e.g. your modded item question is answered in the Registration section under @ObjectHolder Since you don't show your code, I have no idea why it gives you 2 items. I can tell you that a debugger will help you understand what is happening. By the way, earlier you posted a screen shot of your code. Don't do this. In some forums posting text as images will get your thread locked or deleted, not here though, people will just complain. ๐ You should always post code using <> tool so we can clearly see it and quote it.
-
[1.18.2] Error trying to register a custom feature based on KelpFeature [SOLVED]
These aren't forge/minecraft questions, these are java questions. We don't really answer those here. Knowing java is a prerequisite for minecraft modding. But since one of them is partly minecraft related I will answer them. Your main problem is you are not passing the correct parameter types or not passing parameters at all. (basic java). () -> new PlacedFeature(MY_KELP_CONFIGURED.getHolder().get())))); This constructor takes 2 parameters, you are missing the List of PlacementModifers which is the whole point of this class. You can see what is done for kelp in AquaticPlacements. event.getGeneration().addFeature(GenerationStep.Decoration.VEGETAL_DECORATION, MY_KELP_PLACED); This methods wants a PlacedFeature not a RegistryObject<PlacedFeature>, use MY_KELP_PLACED.get() - which gives you the real object.
-
Spawning Item in world
The /give command is handled by you guessed it the GiveCommand class. ๐ You are still going to need the Block.use() method, except instead of dropping the item on the ground, you have to put in the player's inventory. Fortunately for you Forge has you covered. You don't need to copy the code from the GiveCommand, you can use ItemHandlerHelper.giveItemToPlayer(player, itemStack, 0);
-
Spawning Item in world
I think you are new to java as well. ๐ * Your code only runs the client because calling super.use() returns PASS which means you don't want to do anything on the server. * Entity.spawnAtLocation is not a static method, your code won't even compile - you need an instance of an entity, e.g. player.spawnAtLocation() Look at CraftingTableBlock.use() - replace displaying the gui with your code Minecraft's interactions methods use an idiom where they are called twice, first on the client and then if you return SUCCESS it calls the same method on the server. Here's a link to the wiki: https://forge.gemwire.uk/wiki/Main_Page you should at least read about "Understanding sides"
-
[1.18.2] Error trying to register a custom feature based on KelpFeature [SOLVED]
You need a placed feature as well. Feature = the thing that places blocks ConfiguredFeature = Configuration(s) of that feature, e.g. how big an ore vein or which ore PlacedFeature = PlacementModifier(s) that decides where to put it, e.g. cactus goes on sand, diamonds generate at the bottom of the world But more importantly you need a Biome that uses it. To modify vanilla biomes see: https://forge.gemwire.uk/wiki/Biome_Modifiers or before 1.19 you use the BiomeLoadingEvent
-
ban a player who has reached the time limit played
look at the code in BanPlayerCommands.banPlayers()
-
Spawning Item in world
There are many different places in the minecraft code that does this (some more complicated than others). Perhaps the simplest is Containers.dropItemStack() which is used to drop items on the ground when you break a chest or furnace, etc. Another would be Entity.spawnAtLocation() which spawns an Item(Stack) at the entity's location. NOTE: You need do this on the logical server.
-
[1.18.2] Error trying to register a custom feature based on KelpFeature [SOLVED]
That's a feature correct? Continuing the theme of reinventing vanilla ๐ Something like (untested code): private static final DeferredRegister<Feature<?>> FEATURES = DeferredRegister.create(Registry.FEATURE_REGISTRY, ExampleMod.MODID); public static final RegistryObject<Feature<NoneFeatureConfiguration>> MY_KELP = FEATURES.register("my_kelp", () -> new KelpFeature(NoneFeatureConfiguration.CODEC)); public static final RegistryObject<ConfiguredFeature<?, ?>> MY_KELP_CONFIGURED = CONFIGURED_FEATURES.register("my_kelp", () -> new ConfiguredFeature<>(MY_KELP.get(), NoneFeatureConfiguration.INSTANCE));
-
[1.18.2] Error trying to register a custom feature based on KelpFeature [SOLVED]
Isn't that trivial? Maybe I don't understand your question. Why you would need your own configured feature for this (it is the same as the vanilla one) unless you intend to use your own/different Feature. public static final RegistryObject<ConfiguredFeature<?, ?>> MY_KELP_CONFIGURED = CONFIGURED_FEATURES.register("my_kelp", () -> new ConfiguredFeature<>(Feature.KELP, NoneFeatureConfiguration.INSTANCE));
IPS spam blocked by CleanTalk.