Solved Differentiating Similar Entities

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

Eggie

New Member
Feb 27, 2019
8
0
0
Skript Version (do not put latest): Skript 2.2-dev36
Skript Author: Bensku
Minecraft Version: 1.8

I am somewhat new to Skript. I started about a week ago and gotten the hang of the basics, but I started getting lost on scripting some complicated stuff. I’m trying to figure this out:

You have spawned in two villagers that are the same (i.e. farmer). I want a way to differentiate these two villagers. I’ve been using set last spawned entity name to something. I’ll call these two villagers “Create” and “Level-Up”

If player rightclicks villager named “Create”
do command /create
Else if player rightclicks villager named “Level-Up”
levels up player...

Can anyone help me with this problem above?
 
Use on rightclick event and add conditions to check if it’s a villager. Set a local var to the name of the clicked entity and make the player execute the local var
 
Status
Not open for further replies.