Commands improvements
qouteall opened this issue ยท 8 comments
- directly create a portal without using extra entities
/portal cb_make_portal {x} {y} {z} {x destination} {y destination} {z destination} {x rot} {y rot} {z rot} {optional: portal nbt data} {optional: destination dim} {optional: scale}
If you want the commands simple, i got a idea to shorten the number of commands down to just 2 for basic interactions. With some cool interactions.
/portal cb_make_portal {x} {y} {z} {x rot} {y rot} {z rot} {x size} {y size} {optional: portal nbt data}
/portal cb_set_pos {destination/portal} {x} {y} {z} {scale} {x rot} {y rot} {optional: z rot}
- When a command is first summoned, its destination is the same as its pos. Its destination rotation is the same but reversed. In order to make a portal go somewhere, you need the cb_set_pos commands.
- {x rot} would take entiys x rot with using ~. If you use ^ it would add it to the portals x rot. For destination or portal itself depending on what you want.
- {y rot} would take entiys y rot with using ~. If you use ^ it would add it to the portals x rot. For destination or portal itself depending on what you want.
- {z rot} would not work with ~, just producing a error. If you use ^ it would add it to the portals z rot. For destination or portal itself depending on what you want.
- The command would inherit the dim its being executed in. So lets say you want to move the portal into the nether. With the scale thing.
/execute as @e[name=portal] at @s rotated as @s in minecraft:the_nether run portal cb_set_pos portal ~ ~ ~ 8 ~ ~
- For dynamic z manipulation, you can do this. Pretty simple.
/portal cb_setz {scoreholder} {scoreboard}
Now, i think that is a elegant solution for the commands.
Here are some other ideas for command changes:
portal specific accessor
/portal set_portal_specific_accessor {entities}
/portal set_portal_specific_accessor @e[type=pig,name=guy]
/portal clear_portal_specific_accessor
- When something is about to pass thru the portal, check if they are within the selector, if yes, allow them to teleport. If not, don't.
For Box Portals
/portal cb_box {x1} {y1} {z1} {x2} {y2} {z2} {out facing/in facing} {optional: north data} {optional: south data} {optional: east data} {optional: west data} {optional: top data} {optional: bottom data} {optional: empty}
- out facing/in facing would be used to make the portals face inwords or outwords.
- the data for each side is so you could add tags, custom names, or commands on tp to them
- If empty is false. Then oposite sides of the box link. North to south, etc. If true, its destination is the same as its pos. Its destination rotation is the same but reversed. In order to make a portal go somewhere, so you can use cb_set_pos commands, so players can set destinations themselves.
Shape Commands
another idea, is to add the ability to edit portal shape more then just making it round like:
/portal reset_shape
/portal make_circle
/portal set_shape <list of shape points, <x> <y>>
/portal set_shape 0.5 0.5 -0.5 0.5 -0.5 -0.5 0.5 -0.5 0.5 0.5 # this would make the portal a square or rectangle.
- You would list points. These points are posestioned on the plane of the portal. 0,0 being the center of the portal, {1,1} being the right-top conrner, {-1,-1} being left-bottom corner, and so on. The points would link together and form the shape of your portal.
- If the portal is 10 by 5 for example, the example above would mean 100.5, 50.5, so a rectangle 5 by 2.5 would be the portal.
As another idea:
Outputs
/portal get_value {value} {scale}
/portal get_value x_rot 1
/portal get_value y_rot 1
/portal get_value z_rot 1
/portal get_value x_rot_des 1
/portal get_value y_rot_des 1
/portal get_value z_rot_des 1
/portal get_value x_size 1
/portal get_value y_size 1
/execute store result score @s num run portal get_value x_rot 10
- Would output these values to imput into scoreboards and do math with. Similar to /data, but your rotations are not in degrees inside of the portals data, so a way to output them is a good idea. Scale would be multiplyed by the value before its outputed. EG:
x_rot value in degrees is 12.2223123
/portal get_value x_rot 10 -> 122
/portal get_value x_rot 1 -> 12
/portal get_value x_rot 0.1 -> 1
My current design:
As it's using euler angles, I want to put it into the euler subcommand.
And there is already /portal set_portal_position that changes only position. To avoid confusion, I am going to change that to "this side" and "other side"
/portal euler make_portal <x> <y> <z> <pitch> <yaw> <width> <height> <scale> <nbt>
/portal euler set_this_side <x> <y> <z> <pitch> <yaw> <width> <height> <nbt>
/portal euler set_other_side <x> <y> <z> <pitch> <yaw> <nbt>
/portal euler set_this_side_roll <scoreHolder> <objective>
/portal euler set_other_side_roll <scoreHolder> <objective>
The dimension is grabbed from source.