# ========================= ITEM FOR INVISIBILITY ========================= # # Author: Optifyne (https://akcel.fun) # Video review: https://youtu.be/jh1yc6OiUJg # The event is not fully-ideally configured for the video review simpleness! # Here is how you can improve it: # 1. You can use "cooldown" option (5 seconds) on the "invisibilityItemActivator" event to exlcude spamming on the item – https://ajneb97.gitbook.io/conditionalevents/config-tutorial#cooldown; # 2. You can use %action_type% placeholder in conditions to specify the the necessity to only right click on the item or other variations, see available values here in "Variables" https://ajneb97.gitbook.io/conditionalevents/event-types/item-events#item-interact; # 3. You can use "and" condition separator in conditions to not specify all conditions in different lines, but in one line for convenience – https://ajneb97.gitbook.io/conditionalevents/conditions#basic-functionalities; # 4. You can use entitiesInRadius placeholder from addon (https://optifynes-organization.gitbook.io/ce-aapp/ce-aapp/placeholders/independent-placeholders/placeholder-for-entities-in-radius#check-presence-of-entities) to check the entities presence in the radius before the "to_range" action, then in case of presence execute "to_range" actions (https://ajneb97.gitbook.io/conditionalevents/conditions#execute-option), otherwise execute actions with some message about "error"; # 5. You can use entitiesInRadius placeholder from addon again, but already another subtype (https://optifynes-organization.gitbook.io/ce-aapp/ce-aapp/placeholders/independent-placeholders/placeholder-for-entities-in-radius#get-list-of-entities) to output the affected players as the list to the player who used the item, and not as new message each time when "call" event is called (for that do not forget also to remove WHOLE "message" action from "call" event and use it under the "to_range" action in the first event); # 6. You can use sounds actions (https://ajneb97.gitbook.io/conditionalevents/actions#play-sound), particles actions (https://ajneb97.gitbook.io/conditionalevents/actions#particle) and other cosmetic/visual/audio elements to decorate the event. # "Change_visibility" Action on the wiki - https://optifynes-organization.gitbook.io/ce-aapp/ce-aapp/actions/independent-actions/change_visibility # CE AAPP Main - https://akcel.fun/ce-aapp # CE AAPP Wiki - https://optifynes-organization.gitbook.io/ce-aapp/ # CE AAPP Spigot - https://www.spigotmc.org/resources/conditionalevents-actions-and-placeholders-pack-ce-aapp.123879/ # CE AAPP GitHub - https://github.com/Optifyne/CE-AAPP # ConditionalEvents plugin - https://www.spigotmc.org/resources/conditionalevents-custom-actions-for-specific-events-1-8-1-21-7.82271/ # ===== ACTIONS WHEN CLICKING ON THE ITEM TO ACTIVATE THE FUNCTIONALITY ===== # invisibilityItemActivator: type: item_interact # Activate the event when player interact with the item conditions: - '%item% == NETHER_STAR' # Item should be nether star - '%item_name% == Hider' # Item should be named as "Hider" (it does not matter with color codes or without) - '%item_custom_model_data% == 5' # Item should have custom model data in "5" value for more uniqueness actions: default: - 'to_range: 10;false;false: call_event: invisibilityItemAction;%source%=%player%' # Call the event with main actions to all players in 10 blocks radius around the current player (excluding entities and current player); We need this call event to not "forget" all players which were affected in "to_range" and use them after delay again; The call event will be called as many times as there will be players around the current player (each time for new player); %player% = who used the item # ===== ACTIONS OF FUNCTIONALITY OF THE ITEM ===== # invisibilityItemAction: type: call # Activate the event when we call it manually actions: default: - 'to_player: %source%: message: &aYou are now invisible for &6%player% &afor &65 &aseconds!' # Message to display for the player who used the item (%source%) about players which were affected by the item - 'change_visibility: %player%;HIDE;%source%' # Hide the user of the item (%source%) for the current player in "to_range" (%player%) - 'wait: 5' # Wait 5 seconds - 'change_visibility: %player%;SHOW;%source%' # Show the user of the item (%source%) for the current player in "to_range" (%player%)