#How to make item has glowing effect only when monster dropped it

8 messages · Page 1 of 1 (latest)

jaunty gale
#

I used LootJS, but it doesn't help...

grim thunderBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

balmy lily
#

If its a custom item, you would use .glow()

floral condor
#
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

jaunty gale
#

Ohhhhh. Thanks. I'll try and report