Chat Redemptions icon

Chat Redemptions -----

A plugin that adds the ability for your stream chat to do things in-game using an API.



This plugin can spice up your server so people can trigger things in-game by using an API. That means you can make a discord bot, or even a twitch chat bot like Nightbot or StreamElements trigger things in-game with commands to affect a specific player or all the players!

Installation
1. Put the ChatRedemptions-1.1.jar into the plugins folder of your server.
2. Start the server
3. Open the config in plugins\ChatRedemptions\config.yml.
4. First of all, change the pass to something new. This is just for security reasons. I'd recommend just generating a UUID online and using that.
5. Scroll down, change any of the options as you'd like them (if needed).
6. When you scroll down to the redemptions part, there will be a giant paragraph telling you what to do and how to configure redemptions.

To make your bots trigger things, just look through their features to see how you can make the bot make API requests. Many/most modern bots are capable of this.

If you are using a server host (assuming it uses the standard multicraft panel) :
1. Click on the advanced tab on the left side.
2. Click on Additional ports.
3. Click add a port.
4. It should add a random port that isn't already in use. Just copy that port and put it for the 'port' value in the config.yml file for the plugin.
5. Save everything and you're done. Just restart the server so it changes to the new port.

If you have any questions at all, feel free to message me (Gaymer#6201) on discord, or join my discord server. I'd be more than willing to help you set it up.



Permission 'bundles':
  • chatredemptions.* (literally everything)
  • chatredemptions.streamer (use, generate, see, delete and toggle)

List of all permissions:
  1. chatredemptions.use: Gives the player access to use the main command.
  2. chatredemptions.reload: Gives the player access to reload the plugin.
  3. chatredemptions.test: Gives the player access to test redemptions.
  4. chatredemptions.generate: Gives the player the ability to generate the pass for redemptions for themselves. (Only if per-player-pass is enabled)
  5. chatredemptions.generate.others: Gives the player the ability to generate the pass for redemptions for others. (Only if per-player-pass is enabled)
  6. chatredemptions.see: Gives the player the ability to see the pass for redemptions for themselves. (Only if per-player-pass is enabled)
  7. chatredemptions.see.others: Gives the player the ability to see the pass for redemptions for others. (Only if per-player-pass is enabled)
  8. chatredemptions.delete: Gives the player the ability to remove the redemptions feature for themselves. (Only if per-player-pass is enabled)
  9. chatredemptions.delete.others: Gives the player the ability to remove the redemptions feature for others. (Only if per-player-pass is enabled)
  10. chatredemptions.toggle: Gives the player the ability to toggle redemptions for themselves. (Only if per-player-pass is enabled)
  11. chatredemptions.toggle.others: Gives the player the ability to toggle redemptions for others. (Only if per-player-pass is enabled)
  12. chatredemptions.toggleglobal: Gives the player the ability to toggle redemptions globally.

Code (YAML):
#
# how to make requests:
# here's a template: %address%:%port%/?pass=seeBelow?redemption=nameOfRedemption?target=usernameOfTargetedPlayer?sender=senderOfChatCommand
#
# variables for requests:
# [REQUIRED] pass: the pass (see below)
# [REQUIRED] redemption: which redemption you want to trigger
# [REQUIRED] target: the targeted player's in-game username
# [REQUIRED] sender: the person who initiated the redemption (i.e. twitch username or similar)
# [OPTIONAL] nickname: in case you want to use the nickname variable in messages and titles
#
# please replace this with something new.
# just generate a uuid online or something.
# you can generate one here: https://www.uuidgenerator.net/
pass
: replaceThis

# enable this if you want a separate pass for every player on the server.
# if this is enabled, the pass above does not matter and is completely irrelevant.
# default is false
per-player-pass
: false

# this is the port that the plugin will be using to recieve API requests.
#
# if you are on a server host, there would usually be an "additional ports" option somewhere on the control panel, most likely under the advanced tab.
# just go to that tab and click add port. then copy that port and put it here. you will be using this port to make requests. (i.e. yourserver.com:8080/?pass=whatever etc.)
port
: 8080

# keep this as false unless you know what you're doing or you've been asked to turn it on. it just outputs a lot more info to the console.
debug
: false

# the messages that will be returned
responses
:
  missing-arguments
: 'Error : Missing arguments.'
  invalid-arguments
: 'Error : Invalid arguments.'
  invalid-pass
: 'Error : Invalid pass.'
  no-such-redemption
: 'That is not a redemption.'
  target-offline
: 'Target is offline.'
  redemption-on-cooldown
: 'This redemption is still on a cooldown. ( %s)'
  redemptions-disabled-globally
: 'Redemptions are currently disabled globally.'
  redemptions-disabled-for-player
: 'Redemptions are currently disabled for this player.'



# -------------------------------------
#
#               OPTIONS
#
# -------------------------------------

options
:

  # whether or not ChatRedemptions should remember whether or not it was enabled/disabled on every startup or reload
  # default is true
  keep-enabled-on-restart
: true
  # if above is enabled, should it be enabled by default?
  # default is false
  enabled-on-startup
: false

  # have some extra fun. disable cooldowns.
  # default is false.
  disable-cooldowns
: false

  # whether redemption cooldowns should be per-player instead of global.
  # default is true
  per-player-cooldown
: true


# -------------------------------------
#
#             REDEMPTIONS
#
# -------------------------------------
#
# here is an example for reference:
# 1creeper:                                                                       <-- (the name of the redemption, this is not necessarily shown to the public)
#    cooldown: 60                                                                 <-- (this is in seconds)
#    message: 'You successfully spawned 1 creeper on your streamer.'              <-- (what the API sends back)
#    execute:                                                                     <-- (what should be executed when this is redeemed)
#      - [mob, creeper, 1, everyone]                                              <-- (this will spawn 1 creeper on all online players)
#      - [actionbar, "You were given 1 creeper by %sender%.", player]             <-- (this will give an actionbar title to the target. "%sender%" will be replaced as defined below)
#      (see below for more)
#
# variables (surround with %%):
# player: the targeted player, defined by the API request.
# sender: the server of the chat command, defined by the api response
# nickname: the nickname of the target (if defined by the API request; otherwise player)
#
#
#
# types of things you can execute
#
# spawn:
# this spawns a specific amount of a type of mob on top of (inside) the targeted player or everyone
# format: [spawn, <type of entity>, <amount>, <player or everyone>]
#
# item:
# gives or takes items from the targeted player or everyone
# format for give: [item, give, <item type>, <amount>, <player or everyone>] or [item, give, <saved item name>, <player or everyone>]
# format for take: [item, take, <item type>, <amount or all>, <player or everyone>];
#
# sound:
# plays a sound for targeted player or everyone (see list of sounds here: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Sound.html)
# format: [sound, <sound>, <player or everyone>]
#
# clear:
# clears the the entire inventory or parts of the inventory of the targeted player or everyone
# format: [clear, <inventory, hotbar or hand>, <player or everyone>]
# OPTIONAL: if you want to replace all cleared items with a saved item, add the name of the saved item as an extra argument at the end. (i.e. [clear, player, hand, grass])
#
# title:
# sends a title to the targeted player or everyone (use § for color codes)
# format: [<title/subtitle/actionbar>, <text in quotes>, <player or everyone>]
#
# message:
# sends a chat message to the targeted player or everyone (use § for color codes)
# format: [message, <text in quotes>, <player or everyone>]
#
# damage:
# causes a set amount of damage to the targeted palyer or everyone
# format: [damage, <amount or kill>, <player or everyone>]
#
# stat:
# sets a statistic for a player or everyone
# format: [stat, <health or hunger>, <amount>, <player or everyone>]
#
# command:
# literally just sends the specified command from the console
# format: [command, <command (in quotes)>]
#
redemptions
:
  1creeper
:
    message
: 'Spawned 1 creeper on %player%.'
    cooldown
: 600
    execute
:
     - [actionbar, "You were generously gifted 1 creeper by §c%sender%§f.", player ]
      - [message, "§c%player%§f was generously gifted 1 creeper by §c%sender%§f.", everyone ]
      - [spawn, creeper, 1, player ]
  5creeper
:
    message
: 'Spawned 5 creepers on %player%.'
    cooldown
: 1200
    execute
:
     - [actionbar, "You were generously gifted 5 creepers by §c%sender%§f.", player ]
      - [message, "§c%player%§f was generously gifted 5 creepers by §c%sender%§f.", everyone ]
      - [spawn, creeper, 5, player ]
  1zombie
:
    message
: 'Spawned 1 zombie on %player%.'
    cooldown
: 300
    execute
:
     - [actionbar, "You were generously gifted 1 zombie by §c%sender%§f.", player ]
      - [message, "§c%player%§f was generously gifted 1 zombie by §c%sender%§f.", everyone ]
      - [spawn, zombie, 1, player ]
  5zombie
:
    message
: 'Spawned 5 zombies on %player%.'
    cooldown
: 1200
    execute
:
     - [actionbar, "You were generously gifted 5 zombies by §c%sender%§f.", player ]
      - [message, "§c%player%§f was generously gifted 5 zombies by §c%sender%§f.", everyone ]
      - [spawn, zombie, 5, player ]
  5skeleton
:
    message
: 'Spawned 5 skeletons on %player%.'
    cooldown
: 1200
    execute
:
     - [actionbar, "You were generously gifted 5 skeletons by §c%sender%§f.", player ]
      - [message, "§c%player%§f was generously gifted 5 skeletons by §c%sender%§f.", everyone ]
      - [spawn, skeleton, 5, player ]
  5cavespider
:
    message
: 'Spawned 5 cave spiders on %player%.'
    cooldown
: 1200
    execute
:
     - [actionbar, "You were generously gifted 5 cave spiders by §c%sender%§f.", player ]
      - [message, "§c%player%§f was generously gifted 5 cave spiders by §c%sender%§f.", everyone ]
      - [spawn, cave_spider, 5, player ]
  1irongolem
:
    message
: 'Spawned 1 iron golem on %player%.'
    cooldown
: 180
    execute
:
     - [actionbar, "You were generously gifted 1 iron golem by §c%sender%§f.", player ]
      - [message, "§c%player%§f was generously gifted 1 iron golem by §c%sender%§f.", everyone ]
      - [spawn, iron_golem, 1, player ]
  1hp
:
    message
: 'Set the health of %player% to 1 hp.'
    cooldown
: 300
    execute
:
     - [actionbar, 'You were put to 1 hp by §c %sender%§7.', player]
      - [message, "§c%player%§f was put to 1 hp by §c%sender%§f.", everyone ]
      - [stat, health, 1, player ]
  1food
:
    message
: 'Set the hunger of %player% to 1 hunger.'
    cooldown
: 300
    execute
:
     - [actionbar, 'You were put to 1 hunger by §c %sender%§7.', player]
      - [message, "§c%player%§f was put to 1 hunger by §c%sender%§f.", everyone ]
      - [stat, hunger, 1, player ]
  heal
:
    message
: 'Healed %player%.'
    cooldown
: 300
    execute
:
     - [actionbar, 'You healed by §c %sender%§7.', player]
      - [message, "§c%player%§f was healed by §c%sender%§f.", everyone ]
      - [stat, health, 20, player ]
  feed
:
    message
: 'Fed %player%.'
    cooldown
: 300
    execute
:
     - [actionbar, 'You were fed by §c %sender%§7.', player]
      - [message, "§c%player%§f was fed by §c%sender%§f.", everyone ]
      - [stat, hunger, 20, player ]
  permhunger
:
    message
: 'Gave %player% permanent hunger effect.'
    cooldown
: 1200
    execute
:
     - [actionbar, 'You were given permanent hunger by §c %sender%§7.', player]
      - [message, "§c%player%§f was given permanent hunger by §c%sender%§f.", everyone ]
      - [command, "effect give %player% hunger 10000 0 true" ]
  permpoison
:
    message
: 'Gave %player% permanent poison effect.'
    cooldown
: 1200
    execute
:
     - [actionbar, 'You were given permanent poison by §c %sender%§7.', player]
      - [message, "§c%player%§f was given permanent poison by §c%sender%§f.", everyone ]
      - [command, "effect give %player% poison 10000 0 true" ]
  scare
:
    message
: 'Scared %player% by doing 1 hp.'
    cooldown
: 60
    execute
:
     - [actionbar, 'You were dealt 1 damage by §c %sender%§7.', player]
      - [message, "§c%player%§f was hit for 1 hp by §c%sender%§f.", everyone ]
      - [damage, 1, player ]
  clearhand
:
    message
: 'Cleared the hand of %player%.'
    cooldown
: 300
    execute
:
     - [actionbar, 'Your hand was taken by §c %sender%§7.', player]
      - [message, "§c%player%§f got their hand cleared by §c%sender%§f.", everyone ]
      - [clear, hand, player ]
  clearhotbar
:
    message
: 'Cleared the hotbar of %player%.'
    cooldown
: 1800
    execute
:
     - [actionbar, 'Your hotbar was taken by §c %sender%§7.', player]
      - [message, "§c%player%§f got their hotbar cleared by §c%sender%§f.", everyone ]
      - [clear, hotbar, player ]
  clearinventory
:
    message
: 'Cleared the inventory of %player%.'
    cooldown
: 3600
    execute
:
     - [actionbar, 'Your inventory was taken by §c %sender%§7.', player]
      - [message, "§c%player%§f got their inventory cleared by §c%sender%§f.", everyone ]
      - [clear, inventory, player ]
  give2diamonds
:
    message
: 'Gave 2 diamonds to %player%.'
    cooldown
: 300
    execute
:
     - [actionbar, 'You were gifted 2 diamonds by §c %sender%§7.', player]
      - [message, "§c%player%§f was given 2 diamonds by §c%sender%§f.", everyone ]
      - [item, give, diamond, 2, player ]
  takediamonds
:
    message
: 'Took all diamonds from %player%.'
    cooldown
: 1200
    execute
:
     - [actionbar, 'Your diamonds were taken by §c %sender%§7.', player]
      - [message, "§c%player%§f got their diamonds taken by §c%sender%§f.", everyone ]
      - [item, take, diamond, all, player ]
  kill
:
    message
: 'Killed %player%.'
    cooldown
: 3600
    execute
:
     - [actionbar, 'You were killed by §c %sender%§7.', player]
      - [message, "§c%player%§f was killed by §c%sender%§f.", everyone ]
      - [damage, kill, player ]
  creepersound
:
    message
: 'Played a creeper sound at %player%.'
    cooldown
: 60
    execute
:
     - [actionbar, 'A creeper sound was played by §c %sender%§7.', player]
      - [message, "§c%player%§f heard a creeper because of §c%sender%§f.", everyone ]
      - [sound, ENTITY_CREEPER_PRIMED, player ]
  totemhand
:
    message
: 'Set hand of %player% to totem of undying.'
    cooldown
: 3600
    execute
:
     - [actionbar, 'Your hand was set to totem of undying by §c %sender%§7.', player]
      - [message, "§fHand of §c%player%§f was set to totem of undying by §c%sender%§f.", everyone ]
      - [clear, hand, player, totem_of_undying ]

# -------------------------------------
#
#             SAVED ITEMS
#
# -------------------------------------
#
# this entire section is OPTIONAL.
#
# this section may also seem advanced to inexperienced users.
# do not touch this if you are inexperienced.
#
# these should just be a raw ItemStack

saved-items
:
  totem_of_undying
:
    ==
: org.bukkit.inventory.ItemStack
    v
: 2730
    type
: TOTEM_OF_UNDYING
    amount
: 1
Resource Information
Author:
----------
Total Downloads: 151
First Release: Feb 5, 2022
Last Update: Sep 4, 2022
Category: ---------------
All-Time Rating:
0 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings