KubeJS

KubeJS

107M Downloads

Allow using arrays and tags in BlockEvents.rightClicked target

lonevox opened this issue ยท 3 comments

commented

Describe the feature

Currently only single non-tag resource IDs work. The following would work in this proposal:

BlockEvents.rightClicked(['#minecraft:doors', '#minecraft:trapdoors'], (event) => {
	const { player } = event;
	player.displayClientMessage(Text.of('Right clicked a door/trapdoor'), true);
});

Additional info

This is a nice QoL change. The alternative is filtering for tags manually in the event.

commented

Not gonna happen, sorry; the event system just isn't built for that.

You can however use the listener without an extra id and then just return from the callback if the filter doesn't match

commented

No it's not, only individual IDs are supposed to work

commented

So this is supposed to work?

BlockEvents.rightClicked('#minecraft:doors', (event) => {
	const { player } = event;
	player.displayClientMessage(Text.of('Right clicked a door'), true);
});

Because tags don't work here, only individual IDs.