MFMods
Members-
Posts
370 -
Joined
-
Days Won
13
MFMods last won the day on January 15
MFMods had the most liked content!
Converted
-
Gender
Undisclosed
-
Personal Text
I am new!
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
MFMods's Achievements
Diamond Finder (5/8)
39
Reputation
-
step 1: find a mod that does something like that. (for example, enchantment industry adds liquid experience and liquid hyper-experience.) step 2: see how they did it (for recipes, just look at json files in data subdirectory) bonus: delete everything in parenthesis above and the answer applies to almost any question.
-
of the top of my head (it's been many years and i will not set up the 1.8 workspace): there is a method getBlockMetaSomething (maybe getBlockMetadata or getBlockMeta, not sure); call it after the getBlock call, printout metadata (integer, 0-15). find the values for colors that interest you.
-
if you have a location (BlockPos type, get it from your entity) and a world (Level, also available in any entity), ask the world for light level at that location. you can also ask if the "block" at location can see the sky, etc.
-
1.18.2 Mod issues with The Twilight Forest
MFMods replied to MayDay42's topic in Support & Bug Reports
remove half the mods you have. if that did not solved the problem, repeat (remove half of the remaining half). if it did, culprit is in the removed half. switch groups. remove half. repeat. repeat until you find the culprit. then tell mod authors. -
1.18.2 Mod issues with The Twilight Forest
MFMods replied to MayDay42's topic in Support & Bug Reports
make a new world for testing. do binary search until portal works. -
no. world generation is now done through resources (json files). good news: modpack makers can change most things; bad news: it's a nightmare for devs and you picked a horible task for an inexperienced modder. i'd switch to another plan if you have plans for multiple mods. if you must go forth, check out mcjty on youtube. there are online generators for worldgen jsons, use those (after you go through a tutorial).
-
[1.20.4] Encrypting player secrets - the best way to do it?
MFMods replied to Adil Yilan's topic in Modder Support
not really a minecraft question. what i will tell you is that there are three types of config files: client (you want that one), common (it's the one you want for most things) and server (stored in game save folder; separate values for each save game). -
[1.20.4] Periodic code execution - the best way to do it?
MFMods replied to Adil Yilan's topic in Modder Support
1) figure out how to use events. (find forge community wiki or forge docs) 2) subscribe to level tick event. 3) check that the level in event is overworld. overworld is always loaded. 4) check the side (level.isClient). you likely want to do thing only on server side. 5) get the total time in ticks from the level. compare with saved value and be sure that at least 20 ticks (1 second) have passed. (obviously there are multiple ways to do this part). -
1.20.2 Dynamically creating/loading assets (recipes, textures, models) [1.20.2]
MFMods replied to Korall's topic in Modder Support
yeah, you can do that (make a data pack for recipes and loot tables and make an asset pack for models and textures). i'll tell you right away it would be a lot of work and questionable benefit - there are already mods that allow you to add items with a few lines of text and a png file. there always have been. if you really must, investigate source code of BuddingCrystals by XFactHD. -
you did it on client only. all changes need to happen on the server. client only actions can be particles, toasts, etc. in useOn(), first check the side - if not client then printBlocks. outside of the check, return proper value (see below). do not call super.useOn - let's say you right-clicked a lever. you do not want to generate your island in front of the lever and then flip it as a bonus. have one or the other. you may want to support both via crouching check but i wouldn't. return InteractionResult.sidedSuccess(level_is_client). that will give you a hand animation on client. if you're in a good mood, don't make a hundred BlockPos objects. make one BlockPos.Mutable, call set to move it around before use.
-
> How do I make an item have two textures, one held, and one in the inventory an example of that would be a trident. > Also, how do I double the size of the held item model? open the model in blockbench (or just make a new one). set scale and angles for left hand, right hand, item frame (fixed), etc.
-
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.
-
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.
-
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.
-
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); } }