Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.skriptlang.skript.common.properties.expressions;

import ch.njol.skript.Skript;
import ch.njol.skript.doc.*;
import ch.njol.skript.expressions.base.PropertyExpression;
import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser;
Expand All @@ -16,6 +17,35 @@
import java.util.ArrayList;
import java.util.Locale;

@Name("WXYZ Component/Coordinate")
@Description({
"Gets or changes the W, X, Y or Z component of anything with these components/coordinates, like locations, vectors, or quaternions.",
"The W axis is only used for quaternions, currently."
})
@Example("""
set {_v} to vector(1, 2, 3)
send "%x of {_v}%, %y of {_v}%, %z of {_v}%"
add 1 to x of {_v}
add 2 to y of {_v}
add 3 to z of {_v}
send "%x of {_v}%, %y of {_v}%, %z of {_v}%"
set x component of {_v} to 1
set y component of {_v} to 2
set z component of {_v} to 3
send "%x component of {_v}%, %y component of {_v}%, %z component of {_v}%"
""")
@Example("""
set {_x} to x of player
set {_z} to z of player
if:
{_x} is between 0 and 100
{_z} is between 0 and 100
then:
set y component of player's velocity to 10
""")
@Since("2.2-dev28, 2.10 (quaternions)")
@Keywords({"component", "coord", "coordinate", "x", "y", "z", "xyz"})
@RelatedProperty("wxyz component")
public class PropExprWXYZ extends PropertyBaseExpression<WXYZHandler<?, ?>> {

public static void register(SyntaxRegistry registry, Origin origin) {
Expand Down