Leaderboard
Popular Content
Showing content with the highest reputation since 12/22/20 in all areas
-
2 pointsDo not create a new LazyOptional every time. This defeats the entire purpose of LazyOptional.
-
2 pointsYou know how when you buy a pair of headphones, they come in a box? You have a box labeled "headphones" right now and you're trying to plug it into your computer, but it doesn't have an audio jack.
-
2 pointsSo I just recently wiped my hard drive and I wanted to re-install forge to run wynntils on the wynncraft server but everytime I try to install it it always gives this error: https://imgur.com/CswUiZi I've already tried to restart my pc and disabling the firewall, though it seems other versions (1.16.4) work so I don't know what I'm doing wrong. I did play once on the 1.12.2 version and Java should be the latest version since I just downloaded it off of their site (windows offline 64bit one) so I don't know what I'm doing wrong. Here's the link to the log: https://pastebin.com/8cvJFVPN
-
2 points
-
2 points1.12 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
-
2 points
-
2 pointsNo. Stop. writeToNbt and readFromNbt are for saving to disk. Server-side. If you want to sync stuff to the client (assuming you want to use the vanilla mechanic, which uses NBT), you need to override a couple of methods (warning, this is a giant mess): getUpdateTag - Returns the data that should be sent to the client on initial chunk load (i.e. when it gets into render distance, etc.). Call super here and put whatever data you need to have available on the client in the NBTTagCompound returned from super. Then return it. handleUpdateTag - Called on the client with whatever tag was returned from getUpdateTag. By default this calls readFromNbt, which is a terrible default, but oh well. getUpdatePacket - Called to produce a subsequent update packet. You should return a SPacketUpdateTileEntity here if you need the data on the client to be updated from time to time. In theory you can return a partial update here, but usually it is best to just call getUpdateTag and pass that NBTTagCompound to the packet. The int parameter of the packet constructor can be set to whatever unsigned byte you like best. onDataPacket - Called on the client when the packet produced by getUpdatePacket is received. Usually you just need to call handleUpdateTag with the NBT data from the packet (SPacketUpdateTileEntity::getNbtCompound). getUpdateTag will always be called and it's data sent when the chunk is initially transferred to the client. You cannot stop this. If you need to update the client-side data later (i.e. you need the packet produced by getUpdatePacket to be sent), call World::notifyBlockUpdate on the server. You should care about when you call markDirty. You should not care when writeToNbt and readFromNbt are called. Remember, these are for saving the world to disk. Minecraft will do that when it sees fit. You need to call markDirty after doing the changes (so Minecraft knows to save to disk) and then call notifyBlockUpdate to notify the client of these changes (assuming you are using the syncing mechanism described above). Both happens server-side. That was in the context of "NBT is only used for saving to disk". ItemStacks have the terrible habit of using NBT for runtime storage, which is ugly, cumbersome and inefficient.
-
1 pointYup, thats world gen - i.e. no world access. WorldSavedData cannot be accessed during world gen. You can use IChunk#getBiomes to get biome information.
-
1 pointRead the documentation for invoke.
-
1 pointYou did not pass the instance of the object (zombie).
-
1 pointI could be wrong, but I think you might need to add this code in the constructor: FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup); And you may need to change the setup method to non-static.
-
1 pointThere are several problems which all contribute to the things you are seeing (or rather not seeing): Your event handler for ModelRegistryEvent is not called, because you registered it to the wrong event bus. ModelRegistryEvent is fired on FMLJavaModLoadingContext.get().getModEventBus(), but you used MinecraftForge.EVENT_BUS. You create the RenderMaterial wrongly. Minecraft will use Atlases.getSignMaterial to create the material - which does not match up with what you are doing here. You need to also use that method. This means that the "minecraft" namespace will be used, there is no way around that. Because of this you should prefix the name of your WoodType with your ModID, so "effetewood_effete", to avoid collisions not only with the texture but also the WoodType registry. Then your texture also needs to be in minecraft/textures/entity/signs/effetewood_effete.png naturally. In ModelRegistryEvent you also need to add the RenderMaterial to the set of built-in textures (ModelBakery.LOCATIONS_BUILTIN_TEXTURES) so that Minecraft will actually load the texture and stitch it onto the atlas. Because the field is protected, you can use a little hack to avoid having to use reflection: static class FakeBakery extends ModelBakery { private FakeBakery(IResourceManager resourceManagerIn, BlockColors blockColorsIn, IProfiler profilerIn, int maxMipmapLevel) { super(resourceManagerIn, blockColorsIn, profilerIn, maxMipmapLevel); } static Set<RenderMaterial> getBuiltinTextures() { return ModelBakery.LOCATIONS_BUILTIN_TEXTURES; } } Now you can just call FakeBakery.getBuiltinTextures to get the field and add your RenderMaterial to it. Because you now have your own tile entity type, you need to tell Minecraft to use the SignTileEntityRenderer for it. Use ClientRegistry.bindTileEntityRenderer in FMLClientSetupEvent for that. Registering the wood type in ModelRegistryEvent means it won't be registered on the server. However FMLCommonSetupEvent is too late, so you have to do it in the mod constructor. Unfortunately in this case, mod construction (like many startup events, e.g. FMLCommonSetupEvent) runs in parallel on a threadpool, which means you cannot just register your WoodType there (the underlying data structure ObjectArraySet is not threadsafe). With normal event handlers (like FMLCommonSetupEvent) you can just use enqueueWork on the event to run something synchronously on the main thread. However in this case we are in the mod constructor, which doesn't receive an event instance. There is still a DeferredWorkQueue for us to use though (i.e. call enqueueWork to run something on the main thread): DeferredWorkQueue.lookup(Optional.of(FMLConstructModEvent.class)).get().enqueueWork with a Runnable lambda will do the trick. In there you can then safely register your WoodType. With these fixes the custom sign now works:
-
1 pointProbably not, it was exposed using access transformers most likely. I would say that TelepathicGrunt has a good explanation on how to do this. This should be lax enough so you don't have to copy anything directly but provide enough information on what certain methods do and how to properly use them.
-
1 pointYou can use LivingHurtEvent to modify the amount of damage an entity takes. You can then check the source of the damage (DamageSource#getTrueSource gets you the entity that caused the damage) and check if they are holding your sword.
-
1 pointYou could overwrite the vanilla fishing loot table, yes. However: Vanilla does not do any loot table merging. One datapack wins. So if you and another mod (or another data pack) both modify the fishing loot table, only one wins. That's why Forge has added global loot modifiers, which allow you to specify modifiers that act on the result of loot tables, without replacing them.
-
1 pointUse global loot modifiers to change loot tables.
-
1 pointThat grabs the name from the NetworkPlayerInfo which is separate. You would need to set it from the ClientPlayerEntity in a sided-safe manner.
-
1 pointSupply the property used to determine if the push is grown via BlockState#with and set it to the max age most likely.
-
1 point
-
1 point
-
1 pointhttps://mcforge.readthedocs.io/en/latest/networking/simpleimpl/
-
1 pointRefer to the Optifine downloads page regarding compatibility with Forge.
-
1 point
-
1 pointA capability attached to the player will do what you need then.
-
1 pointIf its saved per player it acts like the player inventory or enderchest. If its saved per itemstack it is tied to that itemstack, so if it is given to a different player they get the inventory.
-
1 pointSo, if the list is empty it means that maybe the features aren't actually added to that list...so the last thing to check is if the OreGen.register method is called
-
1 point
-
1 pointPlayerList#getPlayers. Note that names are not suitable for anything but displaying them to the user - they can change. Internally you should work with UUIDs always. ServerLifecycleHooks.getCurrentServer
-
1 point
-
1 pointThank you for bumping a year and a half old thread to vouch for one of my moderators who has thousands of posts on this forum and was recommending a tool that is widely known/used in the community to fix jar file associations... I was scared that he was saying something wrong!
-
1 point
-
1 pointI'm pretty sure you don't need any Minecraft code to do this. Are you sure that's /assets/skyblock/rooms/ and not /assets.skyblock.rooms/? You know the code you're currently using will crash on a server, right?
-
1 pointIf I understand it correctly getUpdateTag provides the information that needs to be synced (check its doc), and getUpdatePacket provides the packet that going to be send to the client, I think it's fine to put any number for the tileEntityTypeIn (the second parameter of SUpdateTileEntityPacket), since it's hardcoded to check if the tileentity and the number matches. And then onDataPacket is called when the client has received the packet, it provides the data send from the server which you gather the information you need for client from it.
-
1 pointTried it, this is in the client log: Please read your logs.
-
1 point
-
1 point
-
1 pointsomeone who wants to be part of my team. must have at least one of these requirements that I am looking for: !) mod programmer (above all: mob, biomes, objects, weapons and blocks). 2) good at giving realistic animations to the mobs that I will show you. 3) good at textures (they must be "Mowzie's Mobs" style) """write to me with your Discord name""" CERBERUS Guerriero della morte Demone Piccolo drago Piccolo fungo Molti piccoli funghi Fungo medio Fungo gigante rovinare Non morto più solido Troll con tamburo Valhalla Knight
-
1 pointAssuming you are talking about the vanilla inventory here... You will need to indeed override the Slot instance for that particular slot. IItemHandler is not really of use here (neither are capabilities), because this is vanilla code - which knows of neither of those things. So really you are on the right track, you just need to make sure to do it on both client and server. Show what you have attempted so far.
-
1 pointThis: And this: Should both return the same object. So your code is equivalent to Math.sqrt(x*x).
-
1 pointCheck the world save for serverconfig, clear that folder too
-
1 pointI should've put the word map in there. Basically, each biome has an associated registry key which is universally unique. You could grab the registry key of the specific object and pass that into a map to grab an associated object or interface which would allow you to do some custom mechanics for the biomes. It works the same as if it was attached to the object itself, minus a little extra time.
-
1 pointHello, I am trying to learn how to make simple minecraft mods in java. I am following multiple tutorials, and in each one it shows to download the minecraft forge MDK. I do this and it seems to be the all good, however, in the tutorials it shows a that the minecraft forge folder has a folder in it called eclipse. Mine does not have it. I downloaded different versions, but all of them do not seem to have the eclipse folder. Right now I am using 1.15.2-31.1.10, but I tried other 1.15.2 downloads, and even a 1.12.2 download. Please help solve this frustrating problem!
-
1 pointA jar file in your gradle cache is corrupted. The easiest, but brute-force, method is to just delete .gradle in your user home folder. But that will mean you need to re-import any Gradle project.
-
1 pointYou have to make a ChunkGenSettings class and edit it there, that's how i got my sea level to be different. I'm using 1.12.2 however, so idk how different it will be for you. I've just been following tutorials online, nor do I know much about coding in general. Sorry if it's not much help
-
1 pointminecraft 'net.minecraftforge:forge:...' under dependencies in build.gradle and if you are using intellij, there should be a gradle panel. Select it and there should be a refresh button, or when you made changes to the build.gradle file a small window will pop up and asks you if you want to reimport the gradle project.
-
1 pointHowdy Easiest way is just to return full brightness from your particle's method. Particle rendering has changed quite a bit from earlier versions of vanilla and you no longer need to do custom rendering for most particles. eg // can be used to change the skylight+blocklight brightness of the rendered Particle. @Override protected int getBrightnessForRender(float partialTick) { final int BLOCK_LIGHT = 15; // maximum brightness final int SKY_LIGHT = 15; // maximum brightness final int FULL_BRIGHTNESS_VALUE = LightTexture.packLight(BLOCK_LIGHT, SKY_LIGHT); return FULL_BRIGHTNESS_VALUE; // if you want the brightness to be the local illumination (from block light and sky light) you can just use // the Particle.getBrightnessForRender() base method, which contains: // BlockPos blockPos = new BlockPos(this.posX, this.posY, this.posZ); // return this.world.isBlockLoaded(blockPos) ? WorldRenderer.getCombinedLight(this.world, blockPos) : 0; } For a working example, see here https://github.com/TheGreyGhost/MinecraftByExample/tree/master/src/main/java/minecraftbyexample/mbe50_particle -TGG
-
1 pointBlock implements IItemProvider, which provides the asItem method.
-
1 point
-
1 pointWhat is this? This is a collection of common issues and recommendations for the Modder Support subforum. Instead of repeating these things over and over again, a link to this thread can be used instead. This post will be updated as needed. Suggestions either via PM to me or in a separate thread to keep this topic clean.