Go to the block you want to right click on, after go to ''triggers'', find ''On block right clicked'', click the plus to make a new procedure.
After, do this:
Despawn [Get nearest entity at x: x y: y z : z in square cube with size (from how far away you want your block to be able to despawn the entity) of type (your entity)]
Despawn can be found in the ''Entity Management'' tab and ''Get nearest entity'' at the bottom of the ''World Data'' tab.
I'm not sure if that procedure will give a "null" error, but if it does, there is a procedure block that will check if your entity exists within the area, and that will fix a "null" error
Go to the block you want to right click on, after go to ''triggers'', find ''On block right clicked'', click the plus to make a new procedure.
After, do this:
Despawn [Get nearest entity at x: x y: y z : z in square cube with size (from how far away you want your block to be able to despawn the entity) of type (your entity)]
Despawn can be found in the ''Entity Management'' tab and ''Get nearest entity'' at the bottom of the ''World Data'' tab.
Should work like a charm ;)
I'm not sure if that procedure will give a "null" error, but if it does, there is a procedure block that will check if your entity exists within the area, and that will fix a "null" error
Pls tell me