-
Notifications
You must be signed in to change notification settings - Fork 0
Portal actions
Portal actions are actions executed in certain specified situations.
Class dev.kyanitemods.kyaniteportals.content.actions.PortalAction, registerable via dev.kyanitemods.kyaniteportals.content.registry.PortalActions#REGISTRY through a type dev.kyanitemods.kyaniteportals.content.actions.PortalActionType.
-
: The root object.
-
type: The action type ID (see below). -
settings: (optional, unless a location is required) Portal action settings.-
predicate: (optional) Entity predicate for the traveling entity in case of enter actions and travel actions. -
predicate: (optional) Another format forpredicate. Specifies a list of predicates that must pass in order for the action to be executed.-
: A single predicate.
-
-
probability: (optional, defaults to1.0f) Probability of event happening when triggered, from0.0fto1.0f. -
on_success: (optional, defaults to empty list) List of actions executed when this action succeeds.-
: A portal action.
-
-
on_failure: (optional, defaults to empty list) List of actions executed when this action fails.-
: A portal action.
-
-

failure_reason: (optional, defaults to empty list) Filter foron_failure(can be a
string or a
list of
failure reasons). Determines whether this will execute or not based on the reason why the previous action failed. When empty, always executes on failure. Valid failure reasons: probability,predicate, oraction. -
environment: (optional, defaults toserver) The environment where this can be executed. One ofclient,server, orcommon. -
location_options: (can be optional or required, when optional, defaults to being in the center of the entry portal) Determines where the action will be executed.
-
- Additional fields of the action, described below.
-
Plays a sound event to the entity.
Additional fields:
-
sound_event: A sound event. -

volume: A float provider. -

pitch: A float provider.
Sets the teleported entity's position. Location options required.
Additional fields:
-

yaw: A float provider. -

pitch: A float provider.
Creates a Nether-like (rectangular) portal.
Additional fields:
-

frame_block: Frame block placed by the action (can be
block ID,
block state, or
block entity pair). -

portal_block: Portal block placed by the action (can be
block ID,
block state, or
block entity pair). -
size: (optional, defaults to (4, 5)) Size of the portal.-
width: Width of the size object. Must be a positive integer. -
height: Height of the size object. Must be a positive integer.
-
-
teleport_player_to_portal: (defaults to true) Determines if the teleported entity should be teleported to the portal.
Teleports to a Nether portal POI.
Additional fields:
-
point_of_interest_types: Hashed point of interest type tag to be searched. -
portal_predicate: (optional) Determines whether the portal is valid. -
search_range: Range around which to search for the portal POI. -
adapt_coordinate_space: (defaults to true) Determines if the dimension coordinate space should be considered (in the vanilla game, one block in the Nether corresponds to eight in the Overworld).
Stores the action location of this action. The action location can be retrieved by other actions by setting load to the key. See Additional content § Action location for more information
Additional fields:
-
key: The key where the action location will be stored.
Plays a sound event at a location in the world.
Additional fields:
-
sound_event: A sound event. -

volume: A float provider. -

pitch: A float provider.
Spawns particles using the same algorithm as the Nether portal block.
Additional fields:
-

amount: An integer provider which determines the amount of particles spawned. -
particle_options: The particle which will be spawned.
Teleports the entity to the server spawn point.
Makes the teleporting entity win the game the same way as an End portal.
Additional fields:
-
show_credits: (optional) Determines whether credits will be shown or not. If not set, displays credits if the player has not seen them yet.
Sends a message to the player.
Additional fields:
-


text: The text component that will be sent. See Minecraft Wiki:Text component format. -
overlay: If true, the message is displayed in the action bar rather than the chat.