Prevent player destroy blocks

Started by boynet on Sun, 10/25/2020 - 15:40

Topic category: Help with modding (Java Edition)

Last seen on 16:08, 8. Nov 2020
Joined Jan 2015
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Prevent player destroy blocks
Sun, 10/25/2020 - 15:40

I am making a mod that prevents the player from destroying certain blocks with his own hands (like dirt and gravel). But I am not finding a way to do this with procedures.

Sample: 

Procedure Structure

Last seen on 11:10, 23. Nov 2020
Joined Aug 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Your procedure is almost…
Sun, 10/25/2020 - 15:49

Your procedure is almost there. You just need to add the Cancel event that triggered global trigger block from the advanced tab inside your if statement and make the procedure trigger with the A block is broken global trigger.

Last seen on 16:08, 8. Nov 2020
Joined Jan 2015
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Thanks very much :D
Sun, 10/25/2020 - 16:09

Thanks very much :D

Last seen on 16:08, 8. Nov 2020
Joined Jan 2015
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
 would there be any way of…
Sun, 10/25/2020 - 16:14

 would there be any way of not showing that the block is being destroyed?

IN GAME

Last seen on 16:08, 8. Nov 2020
Joined Jan 2015
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
my procedure
Sun, 10/25/2020 - 16:15

my procedure

procedure

Last seen on 11:10, 23. Nov 2020
Joined Aug 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I think this should be…
Tue, 10/27/2020 - 21:40

I think this should be possible by putting the player into adventure mode and giving all the tools CanDestroy tags. I will further test this out and report back with a solution, hopefully soon.

Last seen on 04:53, 26. Nov 2020
Joined Jul 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
that mod would be cool, so…
Thu, 10/29/2020 - 22:47

that mod would be cool, so we need tools to break a block >:D but we should still be able to break wood by hand (this is vital) and maybe to make it a bit more realistic hurt player when they break wood block (it hurts ur hand) and maybe try an external trigger like:

when player (or entity) leftclicks (or breaks) block 

|if block is in tag "logs"

| do 1 damage to [event/target entity]

 

I'm not sure if those blocks/triggers are exactly named that, just use procedure search for block names

adding this would make mc more realistic than ur mod might already make it

Last seen on 11:10, 23. Nov 2020
Joined Aug 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
That's a good point. You…
Fri, 10/30/2020 - 21:54

That's a good point. You would need to be able to break wood to start to make any tools, and what you put there should work. This also highlights a problem with what I suggested for making the blocks not look like they are breaking when you can't break them. If the player is in adventure mode, they can't break any blocks unless they have a tool that has been told it can break a block. This seems to be possible to do if very complicated, but if the player doesn't have a tool, they simply can't break any blocks. Basically, there, unfortunately, doesn't seem to be any way to make the blocks not look like they are breaking using MCreator by itself.

Last seen on 19:07, 16. Nov 2020
Joined Oct 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
how/where can i find the "is…
Sat, 11/07/2020 - 16:55

how/where can i find the "is item in main hand shovel" etc?

Last seen on 19:07, 16. Nov 2020
Joined Oct 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
and that cancel event that…
Sat, 11/07/2020 - 17:10

and that cancel event that triggered global trigger?

Last seen on 11:10, 23. Nov 2020
Joined Aug 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Well, I don't know how to…
Sun, 11/08/2020 - 12:38

Well, I don't know how to check if an item is a specific tool type, but the item in the main hand block is in the Entity procedures tab and the cancel event block is in the Advanced tab.