Solved Spawning entity not working

  • 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.

Herocbslayer

Member
Jul 5, 2021
4
0
1
  1. Script Version (do not put latest): 2.5.3
  2. Script Author: Me
  3. Minecraft Version: 1.16.5
  4. Full Code:
    Code:
    on death:
      if victim isn't player, ender dragon or wither:
        spawn 1 event-entity at location of event-entity


  5. Errors on Reload:
  6. event-entity is not a world (test.sk, line 38: spawn 1 event-entity at location of event-entity')
 
The first one gave the error
'at event-location' is not an entity type

and the second one gave the error
'at location of victim' is not an entity type
 
Code:
on death:
    if victim isn't player, ender dragon or wither:
        set {_mob} to victim parsed as a entity type
        spawn 1 of {_mob} at event-location

maybe this?
 
I'm getting the error 'parsed as a entity type' is not an entity type, I also tried changing a to an, and removing type
 
Wait, what are you trying to do exactly? Because the logic behind your code would be that if the victim is not an ender dragon, a player or a whither, it'd respawn immediately back
 
I have found the problem, it's the location of it, I tried setting the location to a local variable, but it was the same error, but if I use player's location, it spawns in the right mob
[doublepost=1625628880,1625601751][/doublepost]I figured it out, I had to set it to
Code:
on damage:
  if final damge >= victim's health:
    if victim isn't ender dragon, wither, or player:
      set {_entity} to type of victim
      summon 1 of {_entity} at victim's location
 
Status
Not open for further replies.