#can I remove the hoe transforming coarse dirt into dirt interaction?

156 messages · Page 1 of 1 (latest)

sweet aurora
#

how tho?

fast remnantBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

fresh valley
#

yes

sweet aurora
#

tell me how master

fresh valley
#

something like:

BlockEvents.rightClicked('coarse_dirt', e => {
    if(e.item.hasTag('forge:tools/hoes')) e.cancel()
})
#

oh wait

#

there heh

sweet aurora
indigo root
#

Yes would only need to Change the right clicked blockmin the First Line.

sweet aurora
#

this is a block event

#

it goes into server_scripts?

fresh valley
sweet aurora
#

hmmmm

#

can I change it so I can put the coarse dirt inside of the if, not on the beggining?

fresh valley
#

yes, but why? hmmm

indigo root
#

Yes:

BlockEvent.right_clicked(e => {
e.block.id
})
fresh valley
#

the script is faster and easier to read when it's put "on the beginning"

sweet aurora
indigo root
sweet aurora
#

wait what do I put here

#

id?

indigo root
#

Yes iirc

sweet aurora
#

hmmm

#

something is wrong

#
BlockEvents.rightClicked(event => {
    event.block.id('minecraft:coarse_dirt)if(event.item.hasTag('forge:tools/hoes'))e.cancell()
})```
warped harness
#

Why not just do BlockEvents.rightClicked('minecraft:coarse_dirt', event =>{})

sweet aurora
#

this way id need to have many events in the script

#

creating a new event for each stuff seems worse than creating one event

warped harness
#

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

storm idolBOT
#

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.

sweet aurora
#

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

warped harness
#

Ya

sweet aurora
#

it didnt worked

warped harness
#

Logs?

sweet aurora
#

no

indigo root
#

You need to do

if(event.block.id == "minecraft:coarse_dirt")
sweet aurora
#

the script worked

#

it just did nothing

indigo root
#

How you did it

indigo root
sweet aurora
#

so

indigo root
#

You need to Check If it's the one you want

sweet aurora
#
BlockEvents.rightClicked(event => {
  if(event.block.id == 'minecraft:coarse_dirt')
})
#

now what

indigo root
#
if(event.block.id == "minecraft:coarse_dirt" && event.item.hasTag("forge:tools/hoes")){
  event.cancel()
}
sweet aurora
#

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"?

indigo root
#

Yes

sweet aurora
#

what if I wanted to transform it into another block?

#

id change the event.cancel to what?

#

event.Item()?

sweet aurora
#
BlockEvents.rightClicked(event => {
    if(event.block.id == 'minecraft:coarse_dirt' 
    && event.item.hasTag('forge:tools/hoes')){event.cancel()}
    })```
indigo root
#

but the tool has the item tag "forge:tools/hoes"?

robust dagger
sweet aurora
sweet aurora
indigo root
#

|| but you should need and, as you don't want to cancel every click with a hoe

sweet aurora
#

it has forge:hoes

#

not tools/hoes

fresh valley
#

my bad

sweet aurora
#

the tools/hoes does exists too tho

#

its for vanilla ones i think

#

but there's also minecraft:hoes

fresh valley
sweet aurora
#

and bookshelf:hoes

sweet aurora
indigo root
#

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.

warped harness
#

No modded tools use forge:hoes, all hoes from what I can tell have forge:tools/hoes

indigo root
warped harness
#

I wonder why they use that tag instead of the tag everything else uses

robust dagger
#

skill issue

#

doesn't makes sense

#

dor not using

fresh valley
robust dagger
#

for*

#

reduces compatibility

warped harness
#

Ya

sweet aurora
#

I think I can apply the tag '#forge:tools/hoes' to all 'silentgear:hoe'

#

hmmmm

#

ill put the || as well

#

like this?

fresh valley
#

??tryitandsee

storm idolBOT
sweet aurora
#

the map takes like 5 mins to open

warped harness
fresh valley
#

they don't

indigo root
#

you need to add parenthesis arounf the or statement, so it gets prioritiezed i believe

fresh valley
#

they just have some weird syntax highlighting

warped harness
#

Oh

sweet aurora
#

my () is red by default

fresh valley
#

yep

warped harness
#

Interesting

sweet aurora
#

e

#

I think

#

abyss hoes doesnt has tags

indigo root
#

otherwise it will also cancle if you click with a hoe on some other machine

sweet aurora
#

true lmao

#

BUT

#

only with the forge:tools/hoes

#

not the forge:hoes

indigo root
#

yeah

sweet aurora
#

what can I make it to?

#

with the do stuff

indigo root
#

that's the event.cancel() in this case.

#

just didn't want to write that

cursive pier
indigo root
sweet aurora
#

and uses more of my CPU

#

at least with JEI

#

eith REI its very good

#

but it crashes very oftenly

sweet aurora
indigo root
#

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.

sweet aurora
#

ohhhh

#

to change the block I just use event.item()?

#

or another stuff?

#

event.block?

#

does this existe?

indigo root
#

you do this to change the block:

event.block.set('minecraft:stone')
event.cancel()
sweet aurora
indigo root
#

yes, but difficult and probably a lot more laggy that botania does it. Also wouldn't have Jei / Rei integration

#

but technically you could

fresh valley
#

or you couldn't

#

you probably could but in a very weird way

#

which also wouldn't be super optimized

indigo root
#

yes

#

you would need to use something like schedule in Ticks and blockEvents.placed.

fresh valley
#

I thought of level tick, but fair enough despair

indigo root
#

yeah that's also an option, storing where every pure daisy is in a global variable.

sweet aurora
#

hmmmm

#

the botania mana pool has some catalysts

#

I wanted to make it for the pure daisy