Jump to content

Item Generator - Detect Block Name


Qibb

Recommended Posts

I found a post for an item generator and I found it to work well but my one problem is detecting for a certain block name. For example if someone places white concrete it will just be that block. But if that white concrete has the name "Generator" I want it to perform the skript as a generator. Same goes for destroying the block. Here's my skript. 

#Adds the blocks location so that items will spawn on top of it

on place white concrete if name of player's tool is "&b&lGenerator":
    add event-block's location to {generator::1::*}
    send action bar "&b&lEmpire Survival: &7You placed a level 1 generator" to player
    
    
#Removes the blocks location so that items will not spawn on top of it

on break white concrete:
    if {generator::1::*} contains event-block's location:
        remove event-block's location from {generator::1::*}
        send action bar "&b&lEmpire Survival:&7 You removed a level 1 generator" to player

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...