Ads
Module info | |
---|---|
Configuration | ads.yml |
Manager | AdManager |
Support | 1.8+ |
Free version | ✔ |
Proxy-configurable | ❌ |
Ads are clickable text messages displayed in the player's chat. This module prints them in configurable time intervals. They can be used to show useful information and reminders or, more generally, advertisements:
Default configuration (ads.yml
in 1.8+)
ads:
settings:
enabled: true
random-order: true
prefix:
enabled: false
format: '&8[&5&lAds&8] &r'
sound:
enabled: true
id: UI_BUTTON_CLICK
volume: 1.0
pitch: 1.0
sending-timeout: 5m
placeholder-types: []
discord:
texts:
english: |-
&e&lJoin our Discord server:
&b&nstay updated about the new features!
&7&oClick this message to receive the invitation.
italian: |-
&e&lEntra nel nostro Discord:
&b&nrimanete aggiornati sulle novità!
&7&oClicca questo messaggio per ricevere l'invito.
hovers:
english: '&9[Click here to open the link]'
italian: '&9[Clicca qui per aprire il link]'
click:
action: OPEN_URL
values:
english: https://discord.gg/eSnAPhvMTG
italian: https://discord.gg/eSnAPhvMTG
store:
texts:
english: |-
&e&lVisit our Store:
&b&nbuy perks and cosmetics and support the server!
&7&oClick this message to get the link.
italian: |-
&e&lVisita il nostro Store:
&b&ncompra benefici e cosmetici e supporta il server!
&7&oClicca questo messaggio per ricevere il link.
hovers:
english: '&9[Click here to open the link]'
italian: '&9[Clicca qui per aprire il link]'
click:
action: OPEN_URL
values:
english: https://megaproserver.com/store
italian: https://megaproserver.com/store
disabled-ranks:
- staff
- vip
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
Setup
The following snippet of code represents and explains the ads' configuration.
ads:
settings:
enabled: true # whether to enable or disable this module
random-order: true # whether to use a random order when sending the ads
prefix:
enabled: false # whether to add a prefix at the beginning of every ad's line
format: '&8[&5&lAds&8] &r' # the prefix to add, if enabled
sound:
enabled: true # whether to play a sound when sending the ads
id: UI_BUTTON_CLICK # the sound that ads will produce
volume: 1.0 # the sound's volume [0 - 1]
pitch: 1.0 # the sound's pitch [0 - 2]
sending-timeout: 5m # timeout between sendings
placeholder-types: [] # read below
# ...default ads...
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Refer to the Getting started/Syntax/Recognized IDs page to find out the sound IDs specifiable at sound.id
.
Refer to the Getting started/Syntax/Timestamps page to find out the timestamp specifiable at sending-timeout
.
Just like for the other modules, you have to specify which placeholder types you wish to use. Refer to the Modules/Placeholders page for more info.
Adding ads
To add a new ad, you just need to specify its ID and its texts. Note that they support multi line strings. The ID has to respect the following pattern: ^[a-zA-Z0-9-_]{2,36}$
.
# ...ads' settings...
# ...default ads...
new-ad: # ID - required
texts: # required
english: |- # main language's translation - required
&e&lVisit our website:
&b&nstay updated about the new features!
&7&oClick this message to get the link.
italian: |- # other language's translation - optional
&e&lVisita il nostro sito web:
&b&nrimanete aggiornati sulle novità!
&7&oClicca questo messaggio per ricevere il link.
hovers: # optional
english: '&9[Click here to open the link]'
italian: '&9[Clicca qui per aprire il link]'
click: # optional
action: OPEN_URL # read below
values:
english: https://megaproserver.com
italian: https://megaproserver.com
disabled-ranks: # ranks that will not receive this ad - optional
- staff
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
So, in summary, there are 4 configurable sections:
1. texts
This section represents the displayed text in chat; it is required and has to contain at least the translation for the main language.
2. hovers
This section represents the text displayed when hovering the ad; it is optional and nothing will be displayed if it is not specified.
3. click
This section controls what happens when a player click the ad; it is optional and nothing will happen if it is not specified.
The plugin supports 4 click actions specifiable at click.action
:
COPY_TEXT
- copies text to the player's clipboard; only available on 1.15.2+ serversOPEN_URL
- opens the URL in the player's browserSEND_MESSAGE
- makes the player send a messageSUGGEST_TEXT
- suggests text in the player's chat
You can then specify a different value of the click action for every language at click.values
4. disabled-ranks
This is just a list that contains IDs of ranks that should not receive the ad when automatically sent by this module. Useful, for example, not to show ads to VIPs.
Remember to perform /chatplugin reload
after applying changes to configuration files.
/ad
command
You can easily test the ad you have just configured by typing /ad send <your username> new-ad
.
Refer to the Getting started/Commands/Misc page for more info.
ChatPlugin - A complete yet lightweight plugin which handles just too many features!
This wiki is currently updated to version 1.9.10.
© 2024 Remigio07
Please report any mistakes and misspellings as described at Home/Reporting issues.