Skip to content

Portal actions

Pedro270707 edited this page Jul 20, 2026 · 9 revisions

Portal actions are actions executed in certain specified situations.

Technical information

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.

JSON format

  • image: The root object.
    • image type: The action type ID (see below).
    • image settings: (optional, unless a location is required) Portal action settings.
      • image predicate: (optional) Entity predicate for the traveling entity in case of enter actions and travel actions.
      • image predicate: (optional) Another format for predicate. Specifies a list of predicates that must pass in order for the action to be executed.
        • image: A single predicate.
      • image probability: (optional, defaults to 1.0f) Probability of event happening when triggered, from 0.0f to 1.0f.
      • image on_success: (optional, defaults to empty list) List of actions executed when this action succeeds.
        • image: A portal action.
      • image on_failure: (optional, defaults to empty list) List of actions executed when this action fails.
        • image: A portal action.
      • imageimage failure_reason: (optional, defaults to empty list) Filter for on_failure (can be a image string or a image list of image 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, or action.
      • image environment: (optional, defaults to server) The environment where this can be executed. One of client, server, or common.
      • image 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.

Action types

kyanite_portals:play_local_sound

Plays a sound event to the entity.

Additional fields:

  • image sound_event: A sound event.
  • imageimage volume: A float provider.
  • imageimage pitch: A float provider.

kyanite_portals:set_position

Sets the teleported entity's position. Location options required.

Additional fields:

  • imageimage yaw: A float provider.
  • imageimage pitch: A float provider.

kyanite_portals:create_nether_like_portal

Creates a Nether-like (rectangular) portal.

Additional fields:

  • imageimage frame_block: Frame block placed by the action (can be image block ID, image block state, or image block entity pair).
  • imageimage portal_block: Portal block placed by the action (can be image block ID, image block state, or image block entity pair).
  • image size: (optional, defaults to (4, 5)) Size of the portal.
    • image width: Width of the size object. Must be a positive integer.
    • image height: Height of the size object. Must be a positive integer.
  • image teleport_player_to_portal: (defaults to true) Determines if the teleported entity should be teleported to the portal.

kyanite_portals:teleport_to_nether_like_portal_poi

Teleports to a Nether portal POI.

Additional fields:

  • image point_of_interest_types: Hashed point of interest type tag to be searched.
  • image portal_predicate: (optional) Determines whether the portal is valid.
  • image search_range: Range around which to search for the portal POI.
  • image 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).

kyanite_portals:store_action_location

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:

  • image key: The key where the action location will be stored.

kyanite_portals:play_sound

Plays a sound event at a location in the world.

Additional fields:

  • image sound_event: A sound event.
  • imageimage volume: A float provider.
  • imageimage pitch: A float provider.

kyanite_portals:spawn_nether_like_portal_particles

Spawns particles using the same algorithm as the Nether portal block.

Additional fields:

  • imageimage amount: An integer provider which determines the amount of particles spawned.
  • image particle_options: The particle which will be spawned.

kyanite_portals:teleport_to_server_spawn_point

Teleports the entity to the server spawn point.

kyanite_portals:win_game

Makes the teleporting entity win the game the same way as an End portal.

Additional fields:

  • image show_credits: (optional) Determines whether credits will be shown or not. If not set, displays credits if the player has not seen them yet.

kyanite_portals:send_message

Sends a message to the player.

Additional fields: