Started by
predator2505
on
Topic category: Help with Minecraft modding (Java Edition)
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
@mindthemoods
could you show me an example of this?
cuz you i dont know how to put that in a trigger... :/
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.)
@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 :((((
I have a solution but i just need to know, do you want the sack to store multiple players, or only one?
I'll just assume you want it to store multiple mobs/players, so here is what you can do:
If you want to be able to take mobs/players out of the sack, here is what you can do:
I know this all might seem very complicated, but if you want, i could send you a workspace with all of this.
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-)
@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
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.