Villager Chat

 Villager Chat [Paid] 2.1.4

✅ This widget has passed review and has been verified to follow the Widget Gallery Guidelines.

notwiss
he/him

New member
hi hi! not sure if it has been asked before but I am trying to achieve a mix of some users with custom avatars and the rest without them, so I was wondering is there any way to "Hide Villagers" for ALL viewers except for the ones with a permanent exclusive one set up?
 
OP
OP
Zaytri

Zaytri
she/her

Glitch Witch
Admin
Developer
Streamer
hi hi! not sure if it has been asked before but I am trying to achieve a mix of some users with custom avatars and the rest without them, so I was wondering is there any way to "Hide Villagers" for ALL viewers except for the ones with a permanent exclusive one set up?
It will require you to change some of the code, but I think I've made this as simple as possible

  1. Open up script-villager-chat either in a text editor like Notepad or a code editor like Visual Studio Code
  2. Scroll down until you see code like this:
    JavaScript:
    // set emote size  const emoteSize = calculateEmoteSize(parts)
      messageClone.find('.content').addClass(`emote-${emoteSize}`)
    
      // add message type as a class
      messageClone.find('.message').addClass(`message-${message.type}`)
    
      // add villager colors
      messageClone.find('.message').css({
        '--villagerTextColor': villager.color.text,
        '--villagerBackgroundColor': villager.color.background,
      })
    
      const parentClasses = []
  3. Here is the new code you'll be inserting in there:
    JavaScript:
      // hides avatars of users who don't have a permanent villager assignment 
    if (!permanentVillagerMap.get(user.userName)) {
        messageClone.find('.message').addClass('hide-villagers')
      }
  4. The result should look something like this:
    JavaScript:
    // set emote size  const emoteSize = calculateEmoteSize(parts)
      messageClone.find('.content').addClass(`emote-${emoteSize}`)
    
      // add message type as a class
      messageClone.find('.message').addClass(`message-${message.type}`)
    
      // add villager colors
      messageClone.find('.message').css({
        '--villagerTextColor': villager.color.text,
        '--villagerBackgroundColor': villager.color.background,
      })
    
      // hides avatars of users who don't have a permanent villager assignment
      if (!permanentVillagerMap.get(user.userName)) {
        messageClone.find('.message').addClass('hide-villagers')
      }
    
      const parentClasses = []
  5. Save the file
 

notwiss
he/him

New member
It will require you to change some of the code, but I think I've made this as simple as possible

  1. Open up script-villager-chat either in a text editor like Notepad or a code editor like Visual Studio Code
  2. Scroll down until you see code like this:
    JavaScript:
    // set emote size  const emoteSize = calculateEmoteSize(parts)
      messageClone.find('.content').addClass(`emote-${emoteSize}`)
    
      // add message type as a class
      messageClone.find('.message').addClass(`message-${message.type}`)
    
      // add villager colors
      messageClone.find('.message').css({
        '--villagerTextColor': villager.color.text,
        '--villagerBackgroundColor': villager.color.background,
      })
    
      const parentClasses = []
  3. Here is the new code you'll be inserting in there:
    JavaScript:
      // hides avatars of users who don't have a permanent villager assignment
    if (!permanentVillagerMap.get(user.userName)) {
        messageClone.find('.message').addClass('hide-villagers')
      }
  4. The result should look something like this:
    JavaScript:
    // set emote size  const emoteSize = calculateEmoteSize(parts)
      messageClone.find('.content').addClass(`emote-${emoteSize}`)
    
      // add message type as a class
      messageClone.find('.message').addClass(`message-${message.type}`)
    
      // add villager colors
      messageClone.find('.message').css({
        '--villagerTextColor': villager.color.text,
        '--villagerBackgroundColor': villager.color.background,
      })
    
      // hides avatars of users who don't have a permanent villager assignment
      if (!permanentVillagerMap.get(user.userName)) {
        messageClone.find('.message').addClass('hide-villagers')
      }
    
      const parentClasses = []
  5. Save the file
thank you so much! it worked perfectly
 
Back
Top