Item that *stops* time

Started by MDK on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jul 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Item that *stops* time

Hello, im trying to make an item, that stops time. Well, it doesnt stop time but stops every entity from moving hence creating the effect of stopped time. I made an item and tried to make the procedure, but since the global trigger is the player right clicking with the item, the event/target entity is the player. It freezes the game trying to right click the item. I can´t find a way to only target mobs. Source entity can´t be used because the item dependencies dont allow it. Is there any way to just target the mobs?

Here is my procedure:

https://imgur.com/6sqRJN5

Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
The issue is the "while do"…
Mon, 07/17/2023 - 21:36

The issue is the "while do" statement. I've never personally gotten it to work, it always crashes the game. From reading up on it, it has very limited uses, and will 99% of the time, crash the game. 

Solution: keep your "player right clicks with item" procedure, and remove the while do, and set up a new procedure that is "on player update tick" - https://imgur.com/a/ojfKeYK

For this, if the global trigger is set to true, the tick update procedure will begin to run, freezing every entity that is not the user.

Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I forgot to mention, for…
Mon, 07/17/2023 - 21:44

I forgot to mention, for your "player right clicks with item" procedure, you would want to change the velocities to be inside a "for each entity as [entity iterator] procedure. With your current procedure set up as is, you are only getting the velocity of the player that initiated the procedure.

Joined Jul 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Ok, i did everything. I had…
Tue, 07/18/2023 - 08:48

Ok, i did everything. I had to change the Variable to numbers because i wanted to continue the velocity (you didnt mention that). I did everything like this, but i dont know why it doesn´t work. It works once, i hear the glass but then nothing happens when i right click. Any tips on how can also continue the time/velocity?

 

https://imgur.com/jXuiMb6

Joined Jul 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
these are all my procedures*
Tue, 07/18/2023 - 08:48

these are all my procedures*

Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Two things, first the issue…
Tue, 07/18/2023 - 20:03

Two things, first the issue you are having with it only running once - you have the "set frozen to 2" as part of the tick update, so that's going to lock your code, since it's only running the procedure if global frozen = 1.

 

Solution - on the third procedure to resume time, make it if global = 1 run the procedure, and then set the global to 2 within that code. I'm not completely sure the reason for needing the 2 though, as it doesn't have any function (yet).

 

I would also suggest changing velocity variables to NBT data. The global variable is only one number, so when you unfreeze time, all entities will move with the same velocity. If you save the NBT data to the entity iterator and then call it, the variable will be independent to each entity.

 

If you need some visuals, I can send some later when I'm at my computer.

Joined Jul 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yes, that would be helpful…
Wed, 07/19/2023 - 09:31

Yes, that would be helpful. Take your time. I dont use NBT data and tags often so im not very experienced in that area.

Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I condensed your procedure…
Wed, 07/19/2023 - 15:36

I condensed your procedure down to two instead of 3. I moved the Start/Stop freeze to the same procedure since they use the same global.

Here is the start/stop freeze - https://imgur.com/VbwY6lp

Here is the while freeze active - https://imgur.com/WlwTIT1

In short, NBT data is just a variable that is saved to an entity/item/block. Local variables are saved to the procedure instance, and global variables are saved to the game as a whole. By using NBT data, you can save the individual data to a specific entity (multiple numbers can be saved under the same variable for each entity) instead of a global which saves one number for one variable to everything (the number is saved to the game as a whole instead of one entity, so it is only possible to have one number saved to it at a time) 

Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I forgot to mention, I…
Wed, 07/19/2023 - 16:28

I forgot to mention, I changed the global variable to a player_lifetime, that way it can be used in multiplayer (if you're looking for that comparability). You can change your variable under the variable tab, you don't need to create a new one.

Joined Jul 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you so much for…
Wed, 07/19/2023 - 18:09

Thank you so much for helping!! It worked (kinda). I (the player) am getting stopped in mid air when right clicking. I think i found the problem; In your screenshot it said: Set Variable to false/true FOR entity iterator. But I dont have this block in my variables tab. I only have get and set variable to true/false. Did i miss an update or do you have some sort of plugin?

https://imgur.com/a/qad7Ef

 

Joined Jul 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Ok, nvm :D. I have the…
Wed, 07/19/2023 - 18:17

Ok, nvm :D. I have the blocks. But it still doesnt explain the bug. I have warnings in my procedure. Dont know what to do :/

 

https://imgur.com/Sx5ynyg

 

Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Those are just "soft"…
Wed, 07/19/2023 - 18:49

Those are just "soft" warnings regarding NBT capability, it should be fine though, you should be able to run the code without any issues.