#can I remove the hoe transforming coarse dirt into dirt interaction?
156 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
yes
tell me how master
something like:
BlockEvents.rightClicked('coarse_dirt', e => {
if(e.item.hasTag('forge:tools/hoes')) e.cancel()
})
oh wait
there 
if I made smth close it would remove dirt into farmalnd too?
Yes would only need to Change the right clicked blockmin the First Line.
yep
hmmmm
can I change it so I can put the coarse dirt inside of the if, not on the beggining?
yes, but why? 
Yes:
BlockEvent.right_clicked(e => {
e.block.id
})
the script is faster and easier to read when it's put "on the beginning"
so I can use this event for many stuff
This would give you the Block id
Yes iirc
hmmm
something is wrong
BlockEvents.rightClicked(event => {
event.block.id('minecraft:coarse_dirt)if(event.item.hasTag('forge:tools/hoes'))e.cancell()
})```
Why not just do BlockEvents.rightClicked('minecraft:coarse_dirt', event =>{})
this way id need to have many events in the script
creating a new event for each stuff seems worse than creating one event
Ah fair
You're missing end of your string
Also .cancell has an extra l
BlockEvents.rightClicked(event => {
event.block.id('minecraft:coarse_dirt')
if(event.item.hasTag('forge:tools/hoes'))event.cancel()
})```
Try that
If you're working with KubeJS scripts, config files, or similar things, we generally recommend using an actual IDE rather than just Notepad++ and its various siblings.
In a lot of cases, it can help you find errors in your code faster and also gives you neat features like syntax highlighting, automatic formatting, etc!
We recommend Visual Studio Code, since it's lightweight(-ish) and works very well with JavaScript files out-of-the-box.
o the e.cancel needs to be event.cancel
even then smth is off
BlockEvents.rightClicked(event => {
event.block.id('minecraft:coarse_dirt)
if(event.item.hasTag('forge:tools/hoes')) event.cancel()
})```
ohhh the dirt
missing an '
let's test it
Ya
it didnt worked
Logs?
no
You need to do
if(event.block.id == "minecraft:coarse_dirt")
How you did it
hmmm
this way
event.block.id Just Returns the ID of the Block that is right clicked
so
You need to Check If it's the one you want
BlockEvents.rightClicked(event => {
if(event.block.id == 'minecraft:coarse_dirt')
})
now what
if(event.block.id == "minecraft:coarse_dirt" && event.item.hasTag("forge:tools/hoes")){
event.cancel()
}
so this says "if the right click is in "minecraft:coarse_dirt" AND the right click is with "forge:tools/hoes" it will DO NOTHING"?
Yes
what if I wanted to transform it into another block?
id change the event.cancel to what?
event.Item()?
it didnt worked, the coarse dirt did become dirt
BlockEvents.rightClicked(event => {
if(event.block.id == 'minecraft:coarse_dirt'
&& event.item.hasTag('forge:tools/hoes')){event.cancel()}
})```
but the tool has the item tag "forge:tools/hoes"?

lemme check it 0.o
how is the OR in JS symbols?
|| but you should need and, as you don't want to cancel every click with a hoe
my bad
the tools/hoes does exists too tho
its for vanilla ones i think
but there's also minecraft:hoes

can I just put a comma inside the event.item.hasTag or I need to make many event.item.hasTag with || separating them?
if vanilla hoes also have the forge:hoes tag just use that tag.
if they don't either add it or use the logical or.
No modded tools use forge:hoes, all hoes from what I can tell have forge:tools/hoes
this is the andesite alloy hoe though
silent gear do uses
I wonder why they use that tag instead of the tag everything else uses

Ya
I think I can apply the tag '#forge:tools/hoes' to all 'silentgear:hoe'
hmmmm
ill put the || as well
like this?
??tryitandsee
the map takes like 5 mins to open
No, you have errors
they don't
you need to add parenthesis arounf the or statement, so it gets prioritiezed i believe
they just have some weird syntax highlighting
Oh
my () is red by default
yep
Interesting
yep,
if(event.block.id == 'minecraft:coarse_dirt' && (event.item.hasTag('forge:tools/hoes') || event.item.hasTag('forge:hoes'))){
//do stuff
}
otherwise it will also cancle if you click with a hoe on some other machine
yeah
That’s why we use /reload instead of opening and closing the world every change 
that takes also like 3 minutes on big modpacks xd
the reload takes more than reopening
and uses more of my CPU
at least with JEI
eith REI its very good
but it crashes very oftenly
I know, but I was curious in what it is capable of doing
you can also do stuff like reduce the demage of the hoe by a bigger amount, you can change the block to another you can reduce the amount of items in that slot with that you right clicked and so and so on.
ohhhh
to change the block I just use event.item()?
or another stuff?
event.block?
does this existe?
you do this to change the block:
event.block.set('minecraft:stone')
event.cancel()
so I can create my own pure daisy with some events?
yes, but difficult and probably a lot more laggy that botania does it. Also wouldn't have Jei / Rei integration
but technically you could
or you couldn't

you probably could but in a very weird way
which also wouldn't be super optimized
I thought of level tick, but fair enough 
yeah that's also an option, storing where every pure daisy is in a global variable.
