let BUTTON_BLOCKS = ['minecraft:stone_button']
let ROCK_BLOCK = 'notreepunching:stone_loose_rock';

// event listeners
onEvent("block.right_click", event => {

    //if (!arrayContains(item, LIGHTER_ITEMS)) return;
	
	//event.player.tell("face = " + event.block.properties.face)
	
    if(arrayContains(event.block, BUTTON_BLOCKS) 
		&& event.block.properties.face == "floor") {
        event.block.set(ROCK_BLOCK);
		//playsound minecraft:block.vine.break block Proxwian
		//event.cancel();
    }
});

function arrayContains(thing, array) {
    for (var a of array) {
      if (a == thing) return true;
   }
   return false;
};