Trying to create a sack to hold players

Started by predator2505 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Sep 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Trying to create a sack to hold players

Hey yall,

 

trying to create a sort of "sack of holding" but for players totally not going to use this to kidnap my friends

 

ehem

 

But cant seem to find out why it aint working.

 

this is what il have so far.

 

i have the damage check because i have the item have 2 state

 

state 1 (not damaged): empty and should send them to the dimension "Kidnapping" (listen i couldnt think of anything better man xd)

 

state 2 (damaged): Has a player inside and needs to transport them to the location where i r-click

 

Many thanks,

 

Pred

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You might want to use an NBT…
Mon, 02/05/2024 - 11:51
  • You might want to use an NBT tag for the item instead of damage to determine what state it's in. (Damage works, but could cause problems if it interacts with mending, unbreaking, etc.)
  • The problem you're probably having is that, if the player is transported to another dimension, you won't be there to right click them and teleport them back. What you want to do is have a separate trigger for when the item in its full state is right clicked, which should teleport every player in the custom dimension to your position and dimension. (In case you happen to be in the Nether, End, etc; you don't want to just assume Overworld.) You should just be able to get every player in the world as an entity iterator, check if they're in the custom dimension, and if so teleport them back.
Joined Sep 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@mindthemoods   could you…
Thu, 02/08/2024 - 21:10

@mindthemoods

 

could you show me an example of this?

 

cuz you i dont know how to put that in a trigger... :/

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Instead of using a global…
Fri, 02/09/2024 - 11:50

Instead of using a global trigger, use the item's 'on right clicked' trigger. 

Then, if there are no players in your custom dimension, (you could check this using a variable, or just by running an entity iterator that checks if each player in the world is in the custom dimension), you want to check for a player in a certain radius, (say, five blocks), again using an entity iterator. (For each entity in a 5 block radius, if they're a player, set their dimension to your custom dimension.)

Alternatively, if there is a player already in the custom dimension, again use an entity iterator- this time targeting every player, checking if they're in your custom dimension, and if they are, setting their location and dimension to yours. (The event/target entity's.)

Joined Sep 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@mindthemoods   i think i…
Sat, 02/10/2024 - 11:57

@mindthemoods

 

i think i have actual brain rot, i got no clue what im doing now.

 

 

I have it linked to the right click of the item but im still reletivly new to MCreator i just wanted to create something to prank my friends with xd so using stuff like "you could check this using a variable, or just by running an entity iterator that checks if each player in the world is in the custom dimension" has me put in shambles :((((

Joined Sep 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I have a solution but i just…
Sat, 02/10/2024 - 14:33

I have a solution but i just need to know, do you want the sack to store multiple players, or only one?

Joined Sep 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I'll just assume you want it…
Sat, 02/10/2024 - 14:57

I'll just assume you want it to store multiple mobs/players, so here is what you can do:

  1. Download and install https://mcreator.net/plugin/65659/arraylists
  2. Create a new list named SackList
  3. When you right-click on an entity with the sack, add their name to the list and teleport them to the dimension

If you want to be able to take mobs/players out of the sack, here is what you can do:

  1. Create a new GUI named SackGUI
  2. Add a text box in the middle that is editable
  3. Add a button on the bottom with the text Release!
  4. When you right-click the sack, open the SackGUI
  5. Make a new variable named SackName
  6. When you press the button at the bottom, make it so the SackName variable is set to whatever text is inside of the text box, and it will start looking in the SackList for an item that matches the SackName variable
  7. You can do this by starting at the beginning, and if the item isn't the same as the SackName variable, then go to the next item, and repeat this for the entire SackList
  8. If the text can be found in the SackList, then find an entity in the dimension with the same name, teleport them to you, and remove the item from the SackList

I know this all might seem very complicated, but if you want, i could send you a workspace with all of this.

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Here's a basic example of…
Sat, 02/10/2024 - 15:33

Here's a basic example of how you could do this. It would be easier if you had a separate keybind to catch/empty the sack, but this is the basic idea:

You don't need the arrays since you can already essentially get a list of players in each dimension using an entity iterator. That being said, that array plugin sounds extremely interesting, and I will be downloading it immediately. X-)

Joined Sep 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@mindthemoods   Im just…
Mon, 02/12/2024 - 15:53

@mindthemoods

 

Im just guessing here but just making sure, the "end" dimension u set it to would be my sack dimension and the Entity iterator can be anything just has to define a player if im seeing this correctly

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yep, the End dimension would…
Tue, 02/13/2024 - 00:55

Yep, the End dimension would be your custom dimension. Entity iterator, in this case, is every player in the world. So it will run the code inside the orange bracket on every player currently in the world.