Identifying a Spawn

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Endaar

Member
May 2, 2021
2
0
1
Hi,

I have a (3rd party) spigot plugin that spawns custom mobs. I am trying to determine if the mob has spawned, and having zero success after hours of trying. Could I please get some direction on how I can check if an entity with the following data has spawned?

Thanks very much.

Endaar

Skript Version: 2.4.1 and 2.5.3 both tested
Skript Author: I guess that would be me...
Minecraft Version: 1.16.5

This is the output from /data get entity UUID within the game:
Code:
[CHAT] Agatha has the following entity data: {Patrolling: 0b, DeathTime: 0s, BukkitValues: {"ecobosses:boss": "agathagraywitch"}, CanJoinRaid: 1b, Bukkit.updateLevel: 2, LeftHanded: 0b, OnGround: 1b, AbsorptionAmount: 0.0f, Attributes: [{Name: "minecraft:generic.follow_range", Modifiers: [{Name: "Random spawn bonus", Amount: 0.03698472986137704d, Operation: 1, UUID: [I; -1667169858, 387271905, -1160104446, -349857744]}], Base: 20.0d}, {Name: "minecraft:generic.max_health", Base: 800.0d}, {Name: "minecraft:generic.movement_speed", Modifiers: [{Name: "ecobosses-movement-multiplier", Amount: 0.0d, Operation: 2, UUID: [I; -920476964, -1860612500, -1751505645, -1590143612]}], Base: 0.25d}, {Name: "minecraft:generic.attack_damage", Base: 25.0d}], PatrolLeader: 0b, Invulnerable: 0b, Brain: {memories: {}}, Paper.Origin: [13.67842622060279d, 1.0d, -253.98488987456082d], Bukkit.Aware: 1b, CustomNameVisible: 1b, ActiveEffects: [{Duration: 90, ShowIcon: 1b, Ambient: 0b, ShowParticles: 1b, Id: 19b, Amplifier: 0b}], HandDropChances: [0.085f, 0.085f], ArmorDropChances: [0.085f, 0.085f, 0.085f, 0.085f], Rotation: [20.202179f, 0.0f], HurtByTimestamp: 463, WorldUUIDMost: -8457579685048464240L, CustomName: '{"extra":[{"text":"Agatha"}],"text":""}', ArmorItems: [{}, {}, {}, {}], HandItems: [{}, {}], Air: 300s, UUID: [I; -920476964, -1860612500, -1751505645, -1590143612], Spigot.ticksLived: 530, Wave: 0, FallDistance: 0.0f, WorldUUIDLeast: -8956101668986738948L, Motion: [0.0d, -0.0784000015258789d, 0.0d], Pos: [12.794861517120317d, 1.0d, -253.7937969436359d], Fire: -1s, CanPickUpLoot: 0b, Health: 799.85f, HurtTime: 1s, FallFlying: 0b, PersistenceRequired: 0b, PortalCooldown: 0, Paper.SpawnReason: "CUSTOM"}

Troubleshooting:
Searched through docs, forums, etc. I am new to Skript, but not new to coding, and have tried dozens of ways/syntax to check this spawn. I can check for a generic witch, I have been able to pull other bits of data from the above, such as the UUID, so I can't be that far off, but I am at my wit's end. Thanks so much.
 
Code:
every second:
    loop all zombies:
        if loop-entity's name is "name":
            # Do stuff
depending on how many mobs there are it can be laggy, but it should work
 
Code:
every second:
    loop all zombies:
        if loop-entity's name is "name":
            # Do stuff
depending on how many mobs there are it can be laggy, but it should work

Thank you for the reply. I think my main issue is I cannot get anything to match the entity name that the plugin is generating. I see the name in the /data output, but Skript doesn't seem to, which is why I figured I must be doing something wrong.
 
Status
Not open for further replies.