Java Code Examples for org.bukkit.metadata.Metadatable#removeMetadata()

The following examples show how to use org.bukkit.metadata.Metadatable#removeMetadata() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ExprMetadata.java    From Skript with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void change(Event e, @Nullable Object[] delta, Changer.ChangeMode mode) {
	for (String value : values.getArray(e)) {
		for (Metadatable holder : holders.getArray(e)) {
			switch (mode) {
				case SET:
					holder.setMetadata(value, new FixedMetadataValue(Skript.getInstance(), delta[0]));
					break;
				case DELETE:
					holder.removeMetadata(value, Skript.getInstance());
			}
		}
	}
}
 
Example 2
Source File: Meta.java    From NovaGuilds with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Removes metadata
 *
 * @param obj object
 * @param key key
 */
public static void removeMetadata(Metadatable obj, String key) {
	obj.removeMetadata(key, plugin);
}