how do i make an item that enables or disables spawning of a custom entity

Started by personman1411 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Aug 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
how do i make an item that enables or disables spawning of a custom entity

how do i make an item that enables or disables spawning of a custom entity

Joined Feb 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It's simple:On your Item useā€¦
Fri, 08/02/2024 - 19:52

It's simple:

On your Item use the Event "On Item use" something like that and add a Procedure to that Event and make a boolean check. Everytime you right clicks your Item it will switch between true and false. Then you can make a Procedure with the Global Trigger "Entity Spawns".
First Check if the Entity that spawns is your Entity with the Block that you can find at the bottom of the Category "Logic" called "Is event/target entity (sub)type of [your entity]". After that check if the boolean variable is True. You don't need an else statement just use "if" and then your logic variable. Then cancel the Entity to spawn. Like that: