Problem with item as a portal

Started by Landein207 on Sat, 02/15/2020 - 12:30

Topic category: Help with modding

Last seen on 20:26, 2. Apr 2020
Joined Dec 2019
User points:

User statistics:

  • Modifications:
  • Mods of the week:
  • Forum topics:
  • Comments:
  • Wiki pages:
  • Tracker tickets:
  • Invalid tickets:
Problem with item as a portal
Sat, 02/15/2020 - 12:30

 I did a procedure that changes the player's dimention if dimention id isn't 1 send player to dimention 1 else send player to dimention 2 but the player changes its dimention only that it always ends up in the same place in x:1 y:54 z:-32  and no matters where player is beucause he will always stay in the same place. How can I prevent this form happening?

probably sorry my english

0Upvote this forum topic
Last seen on 01:56, 22. Feb 2020
Joined Feb 2020
User points:

User statistics:

  • Modifications:
  • Mods of the week:
  • Forum topics:
  • Comments:
  • Wiki pages:
  • Tracker tickets:
  • Invalid tickets:
I managed to get this to…
Mon, 02/17/2020 - 18:15

I managed to get this to work by setting NBT tags based on the player's coordinates, and then using those tags to move the player back to the same coordinates after changing dimensions.

Like this:

Set entity data number NBT tag ["playerXPosition"] to [Entity x position]
Set entity data number NBT tag ["playerYPosition"] to [Entity y position]
Set entity data number NBT tag ["playerZPosition"] to [Entity z position]
if [ID of dimension the provided entity is in] = [4]
    do Switch dimension for provided player to Surface
    Move provided entity to x: [Get entity data number NBT tag ["playerXPosition"]
    Move provided entity to y: [Get entity data number NBT tag ["playerYPosition"]
    Move provided entity to z: [Get entity data number NBT tag ["playerZPosition"]
else
    Switch dimension for provided player to Moonscape
    Move provided entity to x: [Get entity data number NBT tag ["playerXPosition"]
    Move provided entity to y: [Get entity data number NBT tag ["playerYPosition"]
    Move provided entity to z: [Get entity data number NBT tag ["playerZPosition"]

That's on the "right click in air" procedure for my item, by the way. It seems to work pretty well.

0Upvote this forum topic
Last seen on 20:26, 2. Apr 2020
Joined Dec 2019
User points:

User statistics:

  • Modifications:
  • Mods of the week:
  • Forum topics:
  • Comments:
  • Wiki pages:
  • Tracker tickets:
  • Invalid tickets:
Thank you very much :)
Tue, 02/18/2020 - 19:47

Thank you very much :)

0Upvote this forum topic
Last seen on 01:56, 22. Feb 2020
Joined Feb 2020
User points:

User statistics:

  • Modifications:
  • Mods of the week:
  • Forum topics:
  • Comments:
  • Wiki pages:
  • Tracker tickets:
  • Invalid tickets:
You're welcome! :D
Tue, 02/18/2020 - 20:31

You're welcome! :D

0Upvote this forum topic