#There is a subject

17 messages · Page 1 of 1 (latest)

valid totem
#

How to check if a player has an object in his hands. For example, 'minecraft:stick' (This is not an event, only the conditions for the event)

harsh pondBOT
#

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

granite latch
#

I know about an event for clicking, not sure about holding

#

not seeing anything

valid totem
#

I want to make sure that if a player clicks on the 'minecraft:note_block' block and has 'minecraft:stick' in his hands, then the event is canceled

tribal hill
#

i think its e.player.mainHandItem

valid totem
#

Thanks

#

And I have one more question, if I want to do not so that it is impossible to click on the block 'minecraft:note_block', but I want it to be impossible to click on all the blocks with the tag '#neoforge:minecraft:music_blocks' , I tried but the error BlockEvents.rightClicked('#neoforge:minecraft:music_blocks', event => {event.cancel()})

tribal hill
#

you cant set the argument for the event to be a tag, only an id

#
BlockEvents.rightClicked(event => {
  if(event.block.hasTag('neoforge:minecraft:music_blocks'))
  event.cancel()
})
valid totem
#

I checked this code and it does not work, the error does not come out, but the action is not canceled

tribal hill
#

i just noticed the ID you provided is wrong

#

check the proper tag

valid totem
#

Yes, it's really wrong '#neoforge:music_blocks'

#

But I checked with the corrected tag and even with other tags nothing works

dark nymphBOT
#

You can find your KubeJS server log in /minecraft/logs/kubejs/server.log.
If you are on 1.18 or 1.16 it will be called server.txt.
Please send the file directly, without links or snippets.