The "Required Tool" Doesn't also use the `HarvestCheckEvent`
Soaryn opened this issue ยท 4 comments
Mod loader
NeoForge
Minecraft version
1.21.x
Mod version
15.1.6
Modloader version
Neo 21.1.6
Modpack info
No response
[IMPORTANT] If bug:
- I have confirmed this bug is reproducible on a minimal setup, not a modpack with many other mods.
[IMPORTANT] If bug: The latest.log file, not the crash report
No response
Issue description
Basically I wanted to add the ability for certain items to break certain blocks. In order to do this though, I can't use data components to set the ToolRules for items I don't own, as the only event we have to modify those components, plays before tags are read in for items.
The alternative way to handle this then, is to use a combination of events in Neo to change the breakspeed and the harvest check. Jade's only problem here is the checkmark vs cancel sign that shows on the tooltip when a block is set to have toolRequired
.
An Example of something without required appears fine. The tier is correct.
However, when looking at something that requires a tool but uses the HarvestCheckEvent
and would allow, it shows it is not correct which may mislead players
Suggested Idea
Have the tooltip when a tool is require just call the event given I think most of the data is already present.
This might be tangentially related to #432 Given that the checks for tiers may result in a similar check since Minecraft changed how their tags work for block break tiers.
I don't see any difference between the two images. And I can't find a class called HarvestCheckEvent
OH! It copied the wrong pic in the second! I am so sorry!
Specifically the pickaxe here.
As for the class it is PlayerEvent.HarvestCheck
. If you use Intellij (no worries if not) double shift is reaaally nice in this regard, just need to make sure you have the include non-project
(The only downside is when you have several mods in the environment, it will see multiple copies of neo)
Just XyCraft featurs I am working on, FramedBlocks, Mek, AE2, and neo, but just making a event subscription of
@SubscribeEvent
private static void harvestCheck(PlayerEvent.HarvestCheck event) {
event.setCanHarvest(true);
}
would be likely enough regardless of mods available to showcase the tooltip on the top bar not showing that the tool can actually mine the block