I have created the following script in an attempt to prevent certain mobs from picking up items/blocks after looking through the discord server and google for similar goals:
let entity = event.entity;
if (entity.type == 'minecraft:zombie' || entity.type == 'minecraft:skeleton' || entity.type == 'minecraft:enderman'){
console.log("value changed")
entity.setCanPickUpLoot(false)}
else {
console.log("value unchanged")}
});```
I can see my logs working correctly, but Endermen can still pick up blocks and I can't figure out a way to test is the nbt value is being applied to any of the entities. I would appreciate some insight on this, thanks!