#I need help for on interact for my garage blocks
1 messages · Page 1 of 1 (latest)
Oh wait, my bad, I was looking at the wrong thing; apologies for that.
it's okay
Perhaps we could narrow down the issue. Here try doing something like this; where you add the sendMessage() method in a few areas, to see if the code is actually running in the various sections.
const GarageDoorInteractComponent = {
onPlayerInteract(event) {
// rest of code
world.sendMessage(`A`);
if (blockOpenState) {
world.sendMessage(`B`);
// rest of code
} else {
world.sendMessage(`C`);
// rest of code
}
}
};
Also, as for something else to check. Are you sure the type ids for the blocks in the various runCommandAsync() methods, where you're using the fill command, are written correctly?
hmm i did it but the fill command not working
Could you elborate? Which letters in the in-game chat did you see?
That would be beneficial to know, considering it would assist in narrowing down the issue.
here you go
Sorry, what?
Please take another look at my message. I believe there's some slight misunderstanding here.
the if else works by using also the 'world.sendMessage'
Oh okay, I see.
yup
Yeah, that's strange; I don't see anything noticeably wrong with the use of the runCommandAsync() methods.
As a side note, something I did notice relates to the use of the playanimation command. Since you're running the command off of the dimension, the radius parameter won't behave as you want. I'm assuming you want all garage door entities within a radius of 5 around the block the player interacted with. As it is now, that won't occur as expected.
Anyway, sorry I couldn't be of any assistance with your main issue. I hope you're able to figure out the source of the issue soon, and get it solved.
ohh good day I did it but the file was on computer while I'm thinking again about the fill command while the entity version was good as of now