-
Posts
18 -
Joined
-
Last visited
Posts posted by Crare1
-
-
Wish you could make huge wheat fields easily and fast? Or wide roads by just walking? Or maybe you have hard time finding spawners or slime chunks?
This mod can do that for you!This mod adds some useful tools for farming, mining and world building.
This mod is not far from vanilla Minecraft. It mostly adds quality of life improvements.
More information down under in the video and here on the curseforge page.
There's also topic on minecraft forum, but I wanted to share it here too.
You can download the mod from here.
Just recently updated the mod for 1.16.3 and 1.16.5. Going to create a version for 1.17.x too. changelog is update regularly in the curseforge files page.
I would like to get some feedback on the mod, what you like or don't like? What other tools could fit in the mod?
Mod spotlight by Kaeden
-
Those work like advancements:
There's a small mention about advancements in recipes section, but doesn't really help much. https://mcforge.readthedocs.io/en/latest/utilities/recipes/
gamepedia is more helpful in this case: https://minecraft.gamepedia.com/Advancements
EDIT: advancements json format: https://minecraft.gamepedia.com/Advancements/JSON_format
about advancement conditions: https://minecraft.gamepedia.com/Advancements/Conditions
to get you started you could use this as a template: it goes under src/main/resources/data/modid/advancements/recipes/item_name.json
{ "parent": "minecraft:recipes/root", "requirements": [ [ "has_item", "has_the_recipe" ] ], "criteria": { "has_item": { "trigger": "minecraft:inventory_changed", "conditions": { "items": [ { "tag": "forge:ingots/iron" } ] } }, "has_the_recipe": { "trigger": "minecraft:recipe_unlocked", "conditions": { "recipe": "modid:mod_item" } } }, "rewards": { "recipes": [ "modid:mod_item" ] } }
- 1
-
gameplay: at 5:55 you can see lag spike. Hole made by the dragon can be seen at 10:50
https://www.youtube.com/watch?v=Rf9CcUNJinM
-
1 minute ago, Kiljaeden053 said:
I disagree, I checked their code an they spawn as part of the structure Directly from IWorldGenerator
I'm not here to disagree with you, nor trying to defend the mod. Just saying the block updates caused after the generation might be the problem for the lag.
-
Ice and Fire mod's dragons spawn in those caves. I don't think it's directly related to world gen on that one. Because after the dragon moves, it breaks a lot of blocks, causing a lot of block updates, which maybe the main reason for the lag on that one. It's a resource hungry mod, that's for sure.
-
Ok finally figured it out. calling this function does all the block breaking, spawning drops, exp and silk touch and fortune enchantment handling and cancels it if needed to.
serverPlayerEntity.interactionManager.tryHarvestBlock(blockPos);
Of course then there's checking it's not remote and only initiating that above method when hitting the center block at start for each surrounding block.
-
1 hour ago, loordgek said:
Yes I've seen that page, what are you trying to tell me? That's for subscribing to the events. Also that's for 1.13.x. Here's new https://mcforge.readthedocs.io/en/1.14.x/events/intro/
This is more inline what I'm trying to do, I think: https://mcforge.readthedocs.io/en/1.14.x/blocks/interaction/#player-breakdestroy
But what is the event that breaks the block and does the rest of the stuff like drops, exp, silktouch-modifiers? Or do I need to write that myself? Clearly the item calls it once when it breaks the block and does the rest, but I don't know how to initiate that same process myself.
Also I'm developing for 1.15.x but the docs are even more lacking at the moment...
16 minutes ago, Draco18s said:That's a good start. As long as you insure that the blockPos you're passing there is one of the adjacent blocks you're trying to break.
Second, the event has a canceled property. If the event has been canceled when it gets back to you, you need to not break the block. This is typically done by:
if(MinecraftForge.EVENT_BUS.post(event)) { //break the block }
I've been looking at this for some time. If I understand right, breaking blocks and harvesting them doesn't really do the same thing am I right? Breaking means removing the block from world/changing it to air or waterlogged fluid that's in there. And harvesting means the action that actually does the dropping of items from the block. So I would need to handle both separately. (BreakEvent + HarvestDropsEvent)
I'm still wondering how it works for the vanilla tools. how they handle it. What starts the whole process after the block is about to break. because it seems whole heck of a job to handle all the echantments, blockdrops and stuff inside the tool's class.
Then there's PlayerInteractionManager.tryHarvestBlock() which seems to do something similar to what I want. Can I use it somehow? At least I can study what it does and simulate that.
Sorry it's late for me I'll get back to this later..
-
On 3/25/2020 at 10:55 PM, Draco18s said:
Register an event listener for the BlockBreakEvent
Inside, check the tool used to see if it has your enchantment
If so, modify the adjacent blocks
(note: if you intend to break and harvest adjacent blocks, you should either invoke the same pathways that items do, or broadcast the related events yourself, in the event that another mod or effect wants to do anything. For example, a permissions mod that prevents a player from breaking blocks in regions they don't have access to because it is owned by another player. Be aware of recursion!).
Ok I don't really get how to call that block break event correctly to do it's thing right. Easy way out is doing world.destroyBlock(), but that of course would skip all the checking and doesn't handle enchantment modifiers.
I've tried to create block break event and post it to the forge's event bus, I only see it happening in the eventhandler that listens to it, but it doesn't seem to do much else, like breaking the block and spawning the drops:
BlockEvent.BreakEvent event = new BlockEvent.BreakEvent(worldIn, blockPos, blockState, player); MinecraftForge.EVENT_BUS.post(event);
-
Trying to figure out a way to handle breaking multiple blocks with enchanted item.
I know how to get the enchantments from tools.
But I'm not familiar how minecraft and forge handles block breaking. Can you call a block break event to happen based on tool used on them?
Some kind of blockbreakevent-handler might be needed..
how to send block break calls though to the world with the item doing it?
I know how to break the blocks, but it doesn't register them as being done by the tool, so it won't apply enchantment modifier effects what should happen with them.(multiple drops, silk touch, experience...)
-
ok figured it out.
format is (like the slim version in forge, maybe the other one works too, but this is fine for me):
{ "homepage": "<url to mod file page>", "promos": { "<mc version>-latest": "<mod version>", "<mc version>-recommended": "<mod version>" } }
And I had little bit trouble with gist-file but figured it out also. The link to the update file needs to be specific so it's getting the latest one. This is where I thought it was caching the file.
mods.toml:
... updateJSONURL="gist.githubusercontent.com/[gist username]/[gist ID]/raw/" ...
Do not include commit id with it. Also filename is not required and in my case it fetched old version for some reason if I put it there.
-
Hi,
I'm trying to add json file for the mod so it informs the user about updates.
But I don't really know what is the right format for it. Documentation seems to be outdated or it doesn't work for some reason. https://mcforge.readthedocs.io/en/latest/gettingstarted/autoupdate/
Also while trying out different formats for that json, Something (gradle? forge?) cached the last result of the json-file and won't fetch it again, how you disable this caching while developing?
Should similar format work than what forge is using for checking updates?
https://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json
there is also this version of the json:
https://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions.json
-
Still haven't figured out how to do that grouping in recipe book. Or is it even possible?
I know people are probably going to use JEI with other mods usually, but it would be nice to group the items in recipe book somehow at least for lighter vanilla like mods.
-
-
24 minutes ago, Draco18s said:
Here's a couple of examples.
You can set up your own conditions as well, I just don't have any ready examples.
Thanks Draco!
Now, do you have to add something else to make this work? Because this didn't work:
I added this json under src/main/resources/data/modid/advancements/recipes
Is my tag written correctly or is it something else for iron ingots?
{ "parent": "minecraft:recipes/root", "requirements": [ [ "has_item", "has_the_recipe" ] ], "criteria": { "has_item": { "trigger": "minecraft:inventory_changed", "conditions": { "items": [ { "tag": "minecraft:ingots/iron" } ] } }, "has_the_recipe": { "trigger": "minecraft:recipe_unlocked", "conditions": { "recipe": "modid:mod_item" } } }, "rewards": { "recipes": [ "modid:mod_item" ] } }
-
8 minutes ago, Draco18s said:
Use advancements instead.
That would actually work in this case better with iron ingots, because you can get them in many ways. I look into it. Thanks!
This is then again another way to do it for custom stuff, that doesn't have advancements.
-
Ok I figured it out.
Subscribe to ItemPickupEvent and unlock players recipe based on whatever item they picked up.
@SubscribeEvent public void onItemPickup(ItemPickupEvent event) { Item item = event.getStack().getItem(); if (item.isIn(Items.INGOTS_IRON)) { PlayerEntity player = event.getPlayer(); ResourceLocation[] recipes = new ResourceLocation[1]; recipes[0] = new ResourceLocation("your_mod_id:mod_item_id"); player.unlockRecipes(recipes); } }
Please do correct me if this is the wrong way to do it. It works though. I did refactor player events to their own class to handle with, but this is basically what it does in its simplest form.
-
Is there a way to make modded item's recipes unlocked in the recipe book by for example picking up crafting material for the given item?
Let's say I pick up an iron ingot and it would unlock a new recipe of modded item.
Also is there a way to group modded items in that recipe book? Currently, my recipes just show in the misc-tab(tab with lava bucket and apple).
I would like to move tool items under tools-tab(tab with axe and sword).
I'm modding for 1.15.2.
How to support modpackers with config files for the mod?
in Modder Support
Posted
What is the best way to support modpackers to edit the mod configurations like recipes and loot tables of the mod?
I would like to support more modpackers or anyone using my mod to configure the mod if they wanted to.
Or is this somehow built-in to forge? Do I need to do anything to make this happen?
What about specific configurations. Some kind of json file support that I can load from mod folder when mod initializes.
Sorry I don't really know much how specifically modpackers do this. Simplest is to collect bunch of mods together, but if you wanna customize it more then I think you need configs of course.