Making a player unable to trade with villagers

Started by MagyTheMage on

Topic category: Help with MCreator software

Active 6 months ago
Joined Feb 2020
Points:
698

User statistics:

  • Modifications: 0
  • Forum topics: 12
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 33
Making a player unable to trade with villagers
Fri, 06/05/2020 - 02:12 (edited)

The idea is simple,as a part of a mod im working with, you can join the Illagers and become evil,

however i want to make it so that Illager players cannot trade with villagers..does anyone have an idea on how i can pull this off?

ive tried spawning another GUI, Closing the GUI using the "close GUI" Process, but i cant figure anything out.

anyone got an idea of a way i could find some way to do this?

Edited by MagyTheMage on Fri, 06/05/2020 - 02:12
Active 5 months ago
Joined Jun 2019
Points:
2788

User statistics:

  • Modifications: 4
  • Forum topics: 48
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 3716
I think it isn't possible…
Fri, 06/05/2020 - 02:34

I think it isn't possible without coding, sorry

 

Active 1 year ago
Joined Mar 2021
Points:
560

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 8
You could make a procedure…
Tue, 12/14/2021 - 01:03

You could make a procedure that executes /data remove @s Offers.Recipes as any villager around the player, although that'll completely erase their trades for all players. Searching for a better way to do this myself.

Active 1 year ago
Joined Mar 2021
Points:
560

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 8
Not even 10 minutes later I…
Tue, 12/14/2021 - 01:12

Not even 10 minutes later I found the answer: After detecting that the player right-clicked a villager wait 1 tick server-side for the Trade GUI to open and immediately close it and if you want you could even play the entity.villager.no sound

Active 8 months ago
Joined Feb 2023
Points:
215

User statistics:

  • Modifications: 0
  • Forum topics: 0
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 2
If the method above does not…
Sun, 04/21/2024 - 11:36

If the method above does not work for someone(like me): when the player right-clicks on villager, make him sit down. The villager in this case - entity. Player - sourceentity. There is no need to set expectations in ticks for server. Sorry for mistakes in language.