#Running a command when right clicking a block,

1 messages ยท Page 1 of 1 (latest)

velvet berry
#

Send your content log

#

Ah i see

#
- onPlayerInteract({event}) {
+ onPlayerInteract(event) {
#

Or

#
onPlayerInteract({ block }) {
velvet berry
#

Do you mean event.player.sendMessage('hi')?

viral remnant
#
const player = e.player; 
player.runCommand('playsound block.composter.fill @s ~~~');```
#

This works for me

#

@dense ember Did it work?

abstract sorrel
#

better

player.playSound('block.composter.fill');
viral remnant
abstract sorrel
#

๐Ÿ‘

viral remnant
#

No problem, that is odd but I am glad the event.player works for you ๐Ÿ˜‰

velvet berry
#

Thats because you defined it as event

#

Variables are a basic programming concept that you should learn before scripting api