#how to get entity id from raytrace

6 messages · Page 1 of 1 (latest)

proud oar
#

so i got my code to detect the mob using raytrace.entity but that only gives their cords when i need it to give a id

StartupEvents.registry("palladium:abilities", event => {

    event.create("nexus:entity_attack")
    
    // Preset icon, can also be changed individually in the power json
        .icon(palladium.createItemIcon('palladium:vibranium_circuit'))

        // Documentation description
        .documentationDescription('Attacks whats the players looking at.')

        // Adding a configurable property for the condition that can be changed in the power json
        .addProperty("damage", "float", 0, "The amount of damage the attack does")
        .addProperty("range", "integer", 0, "The amount of range the attack has")
        .addProperty('damage_type', 'string', 'minecraft:player_attack', 'The type of damage done')
        
        // Handler for what happens during EVERY tick of the ability being active, make sure to check the 'enabled' parameter
        .tick((entity, entry, holder, enabled) => {
            
            if (enabled) {
            const damage = entry.getPropertyByName('damage');
            const range = entry.getPropertyByName('range');
            const damage_type = entry.getPropertyByName('damage_type');
            let target = entity.rayTrace(range).entity
            entity.server.runCommand(`damage ${target} ${damage} ${damage_type}`)
                }
        });
});
mystic auroraBOT
#

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

next pendant
#

what addon is this?

proud oar
#

Its a unreleased mod

hallow swift
#

iirc ${target.uuid} should work

proud oar
#

that worked thanks