i need help with an entity that can spawn items.

Started by thijs_films on

Topic category: Help with MCreator software

Active 10 months ago
Joined Apr 2021
Points:
600

User statistics:

  • Modifications: 0
  • Forum topics: 7
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 9
i need help with an entity that can spawn items.

so im creating a mod with an entity that every in game day spawns a single item.
i have tried things with cooldowns but nothing so far has worked and at this point im back to a blank slate.
if anyone can help i would greatly appreciate it!

Active 4 months ago
Joined Jan 2021
Points:
735

User statistics:

  • Modifications: 2
  • Forum topics: 6
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 198
This is possible with nbt…
Sat, 03/19/2022 - 02:51

This is possible with nbt tags i think and i am not so good with that, so i have a makeshift solution for now.

 

Make a potion effect, then create a "When effect expires".

When effect expires - if (is day in the provided world) do (spawn gem [your item])

 

Then for your entity, go to the "entity tick update".

If Not (is day in provided world) do (add potion effect [the potion effect you made] for [5 ticks]) 

 

The item spawn when its somewhat dark so you can change the ticks in the "expired effect" to a larger number to make it spawn later.

(item spawns at 23500 ticks and one day is 24000 ticks).

 

So this makes the entity drop one item every day, now i only tested this in casual situations but i have no idea how this works for the entity if its for example out of range or on server. Hope this helps for now!

Active 10 months ago
Joined Apr 2021
Points:
600

User statistics:

  • Modifications: 0
  • Forum topics: 7
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 9
i tried it out and it sadly…
Sat, 03/19/2022 - 17:27

i tried it out and it sadly didn't work.
but thank you for the suggestion!

Active 4 months ago
Joined Jan 2021
Points:
735

User statistics:

  • Modifications: 2
  • Forum topics: 6
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 198
Yea, i tested it in 1.17,…
Sat, 03/19/2022 - 18:23

Yea, i tested it in 1.17, might be different if you are using another version. Hope you can figure something out!

Active 10 months ago
Joined Apr 2021
Points:
600

User statistics:

  • Modifications: 0
  • Forum topics: 7
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 9
so, i managed to do it! by…
Sat, 03/19/2022 - 21:30

so, i managed to do it!
by having 2 of the same entity. one that gives the item and then quickly changes into the other that waits untill the next day.
thank you for the help, because before this i didnt know of the 'is day in provided world' trigger before this, so it helped me alot!

Active 4 months ago
Joined Jan 2021
Points:
735

User statistics:

  • Modifications: 2
  • Forum topics: 6
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 198
I am happy that i was able…
Sun, 03/20/2022 - 12:08

I am happy that i was able to help!