#How to make item has glowing effect only when monster dropped it
8 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
If its a custom item, you would use .glow()
EntityEvents.spawned('minecraft:item', e=>{
const {x, y, z} = e.entity;
e.level.getEntitiesWithin(AABB.of(x, y, z, x+0.0001, y+0.0001, z+0.0001)).forEach((entity) => {
if(!entity.isAlive() && entity.isMonster()) e.entity.glowing = true;
});
});
or
EntityEvents.death(e=>{
//if(!e.source.actual || !e.source.actual.isPlayer()) return;
if(!e.entity.isMonster()) return;
e.server.scheduleInTicks(0, ()=>{
e.level.getEntitiesWithin(AABB.of(x, y, z, x+0.0001, y+0.0001, z+0.0001)).forEach((entity) => {
if(entity.type == 'minecraft:item') entity.glowing = true;
});
});
});
if the second one isn't working, increase the range of AABB
Ohhhhh. Thanks. I'll try and report