Creating a Limited Size Dimension

Started by taika on Mon, 05/09/2022 - 00:53

Topic category: Help with MCreator software

Last seen on 19:30, 5. Jun 2022
Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Creating a Limited Size Dimension
Mon, 05/09/2022 - 00:53

Is it possible to create a dimension that has a wall and ends at certain coordinates, making the dimension limited in size?

Last seen on 01:37, 29. Jun 2022
Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I made a mod around this…
Mon, 05/09/2022 - 04:07

I made a mod around this concept but it could be better, I plan on remaking it from scratch eventually. Dimensional Pocketz. You can't make a personal dimension easily with multiplayer support with mcreator without custom code. You can make a dimension, and have a pocket surrounded by barriers that only the player can go to in that dimension as it always teleports them to that spot. This is similar to how the Compact Machines mod works I believe.

For below entity data and player variables are kind of interchangeable it depends on what you want. Variables are easier probably., but hard to call to for an addon mod.

  1. Make the dimension a void dimension with nothing in it
  2. Make 3 Variables global map variables for the X,Y,Z coordinates(dimensionX, dimensionY, dimensionZ)
  3. Make an item to travel to the dimension (If you want a portal I suggest making your own portal, mcreator's will make a portal on the other side, and you can use on collide with triggers, but just add a counter for it work or when coming back through it gets a little complicated. Using an item for this is much easier, and requires more code than this below, I played around with both in my mod, and if thats what you want I could help with that too, but this works well i believe)
  4. In that procedure (EntityTeleport) do:
    1. Check a logic player persistant variable (itemUsed) if false do
      1. Check if the dimension is (modDimension) false do
        1. Set (itemUsed) variable to true, and set 3 different player persistent variables(dimensionSpawnX, dimensionSpawnY, dimensionSpawnZ) to the 3 global variables respectively)
        2. Add 100 or so blocks to the global dimensionX or dimensionY variable (You can add if loops here to figure out whether you need to add 100 blocks in the X or Y direction to make a sort of grid based on a max value if that makes sense, instead of going in a straight line through the dimension, up to your discretion) [This is to set the location for the next person's "pocket"
        3. SAVE THE CURRENT DIMENSION AS A STRING PLAYER VARIABLE (savedDimension) (I didn't do this in my mod, it works well though for the desired effect though) Also save the player x y z location as a number player variable
        4.  execute as entity [execute in (dimensionID) run teleport @s(or get player name) dimensionSpawnX dimensionSpawnY dimensionSpawnZ] **(PUT THIS ALL TOGETHER WITH A CREATE TEXT BLOCK, it will take some testing, I'll help if you need)
      2. else do
        1. execute as entity [execute in (savedDimension) run teleport @s(or get player name) savedX savedY savedZ]
    2. This step is important, add another procedure (DimensionEntered) with the trigger on entity enters the dimension do
      1. If player variable dimensionEntered=false do
        1. Set dimensionEntered to true
        2. Spawn structure you want for the player(Surrounded by barriers or custom unbreakable block, or you could set a procedure if the player gets to far from their dimensionSpawn variables, they are teleported back)

And that should do it. There might be a few errors/things i left out here and there so test it out and let me know if you need more help, I can make a new thing and post pictures it if you need, as my mod contains a few extra things as I used portals and items both.

Last seen on 01:37, 29. Jun 2022
Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
You can also edit this…
Mon, 05/09/2022 - 04:10

You can also edit this around a bit if you want it to be saved to the item, use item data instead of player variables, and the player can have multiple "pockets". That is how I did it for my mod. It may take a bit more than this still just fyi but this should get you going.

Last seen on 01:37, 29. Jun 2022
Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
If you wanna check out my…
Mon, 05/09/2022 - 04:12

If you wanna check out my mod to see how it works exactly, check it out on Curse Forge, as the jar i posted on mcreator isn't updated yet. I haven't gotten around to it as I want to do a full remake eventually, but I'm working on a few other mods right now.

Last seen on 14:30, 11. Jun 2022
Joined Jun 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Hey, I'm tried to do a…
Sun, 06/05/2022 - 13:37

Hey, I'm tried to do a similar thing on my mod and I followed your steps but I run into the same problem every time. the structure don't spawn the first time you enter the dimension, it only show up if you go back in again.