Jump to content


  • Posts

  • Joined

  • Days Won


Everything posted by MFMods

  1. looks like twigs' author changed blocks and didn't update every compat. you're going to have to choose between the two mods until that is fixed.
  2. what he said. ...except instead of state.getBlock() == Blocks.grass you should say state.is(BlockTags.DIRT) . tags are not a new thing and people need to use them. also, instead of that BlockPos constructor use above() call in BlockPos.
  3. so, your wish is to be a real boy? good. first follow a tutorial on how to start dev environment. do not edit anything in the example mod. only after the game starts with example mod, start editing it. vanilla block types are accessible through Blocks class (Blocks.something). find one that matches your block type, follow it to creation to discover the block class. have your block extend that. things like bonemeal, etc. will work but you can override all. loot table (block dropping item) won't work. copy from the most similar block or (not easier) follow a tutorial.
  4. it's a simple problem, that's why solution is easy to miss. you will have one main block (if you have a block entity, attach it to that one) and 4 secondary blocks (adjacent to the center one) and 4 tertiary blocks (in corners, adjacent to two secondary ones). you will have block properties (accessed via blockState.getValue) which need to be enough for you to locate the main block. for example if current block is secondary and its "facing" is south, main block is one to the north. override canSurvive if block is tertiary check two adjacent positions (according to blockState); if either is not secondary, return false. if block is secondary get a position of main, get block, if it isn't primary return false. if block is primary and was just placed return true if block is primary get 4 adjacent postitions, return false if either isnt secondary block return true. that's basically it. you may keep canSurvive() it in one block class or split into two (or three if you must), but that method is the only thing that you need to break multiblocks. you also need this one (identical in all of my multiblocks): @Override public void neighborChanged(BlockState state, Level level, BlockPos rackPos, Block block, BlockPos wallPos, boolean something) { super.neighborChanged(state, level, rackPos, block, wallPos, something); if (!this.canSurvive(state, level, rackPos)) { level.destroyBlock(rackPos, true); } }
  5. 1) there is a player tick event. it fires 20x per second for each player. obviously you don't need that precision, skip 19/20 ticks or even 39/40. check items in inventory there. first check that it's a server player. 2) player has a field holding remaining air. just reset it to max. there are ways of preventing that field from being reduced but those are far more difficult that just setting the field to the max value.
  6. use java 17 for minecraft 1.18 to 1.20. lose optifine, i understand poor framerate, i intimately understand, but since we now have sodium/lithium (use forge ports), optifine can just go and die.
  7. well read the message. it says you have two mods with the same id. go through the list of mods above but go from the end of the list (hint).
  8. https://modrinth.com/mod/stopmodreposts while the problem they try to solve is real, not letting you play when their site is down is not clever.
  9. it was fixed in the new version. https://legacy.curseforge.com/minecraft/mc-mods/better-jukeboxes/files
  10. please share the link then. i would agree that redirecting towards NF communities is somewhat unfair, but only starting now that i know that there is a forge discord.
  11. go to forge community wiki and read about config files. short version: server configs are per-world. common configs are singular (one value for all worlds and all players), client configs are per-players (reserved for visual details). edit: and ffs, do not ask a guessing machine anything. there are forums with real modders, discord servers with real modders, youtube (with 5 real modders and 995 dumbass kids (if you hear a squeaky voice, stop and leave) ), there is FCW... do not ask a guessing machine.
  12. replace file tree line with implementation 'flat.dir:JarName:1.2.3' where filename is JarName-1.2.3.jar under libs. add fg.deobf depending on how the mod A is compiled. alternatively, pull mod A from modrinth or curseforge. clean and simple if there won't be more (or much more) changes to A.
  13. took me a while to stop shuddering. you asked a guessing engine how to do something? you have two options: one - look inside the game code. if you have no patience to do so, you will not make a decent mod. ever. option two - ask living people on forge forum or NF discord.
  14. that is not how we do it in modern era. you probably found decade old instructions on mc forum... if your dependency mod is on curseforge or modrinth, just pull it from there. go to curseforge page of your mod, if there is "legacy" prefix in address bar delete it. find the file, click the copy button. paste into dependencies section (where the jei example line is). if it's not on curseforge/modrinth, use a flat dir dependency (see community wiki). repositories { maven { url = "https://www.cursemaven.com" } } dependencies { minecraft '...' implementation fg.deobf("curse.maven:SOMETHING:SOMETHING") }
  15. try with half of those mods. binary search.
  16. you have a big picture. good for you. now you need to divide it into small solvable problems. those, we might help you with.
  17. override those methods freely. you should and for many blocks you need to. they are not about to be removed. in this case the "deprecated" notice is used wrongly and someone should have introduced a new one.
  18. do not keep client-only code in your main mod class or any class that has anything else in it. it needs to be a separate class with client things (ItemBlockRenderTypes.setRenderLayer call etc.) and nothing else. on a dedicated server, it needs to stay unloaded. to subscribe to an event, use the annotation (preferred way) or the line i gave you above. do not call addListener unconditionally.
  19. your client setup method looks fine. did you add it as a listener in main mod class constructor? DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> FMLJavaModLoadingContext.get().getModEventBus().addListener(ClientEvents::clientSetup)); (replace clientevents with how you called that class)
  20. you already have it. you set RenderType.cutout() in FMLClientSetupEvent. find out why that code doesn't execute.
  21. your renderer extends EntityRenderer which doesn't do much. extend LivingEntityRenderer.
  22. make a handler for ChunkDataEvent.Load event. get pixel colors for your map and add to your data structure. do not worry about that chunk getting unloaded 5 minutes later. you will have to update map later if player builds a big fort, but that can be done in EnteringSection event.
  23. addEffect should be run on server-side (level.isClientSide==false). playSound on client-side (isClientSIde==true).
  24. well you can load a chunk, but i feel you shouldn't. i don't know what you are doing but the game is structured so that parts of the world where no player has been for a while are "frozen", kinda. machines from good-quality mods stop working when in unloaded parts of the world. plants from good-quality mods stop growing. all those modders could have forced part of the world to stay loaded (at a price paid by the player). but they didn't. they didn't say "i don't care how the game is intended to run and that players expect all mods to behave uniformly, because my block is just that important!". when mods keep chunks loaded it's often because the young modder was too lazy to make their block just unavailable at the moment.
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.