Chat Message Display


Author: Pigman168
Created: 2014-03-26T08:41:31-0400
Edited: 2014-04-04T16:39:33-0400
Denizen Version: 0.9.4
Views: 67
Downloads: 764
Likes: 0


WGET
Description: Displays the players message above his head. Will replace most color codes however the player needs to put these in the format "red: | blue: | green:" etc. An example would be:
red:Hi, my name is Pigman168.



ChatMessageDisplay:
  type: world
  events:
    on player chats:
    - run s@ChatMessageTask def:<context.message>

    on entity damaged by entity:
    - if <context.entity.is_player> && <context.entity.passenger.eid> == <context.damager.eid> || <context.entity.get_passenger.get_passenger.get_passenger.eid> == <context.damager.eid> || <context.entity.get_passenger.get_passenger.eid> == <context.damager.eid> || <context.entity.get_passenger.eid> == <context.damager.eid> {
      - determine cancelled
      }

ChatMessageTask:
  type: task
  script:
  - define message %1%
  - mount e@slime[velocity=0,0,0;custom_name=%message%;custom_name_visibility=true;size=-2]|e@skeleton[velocity=0,0,0]|e@skeleton[velocity=0,0,0]|<player>
  - invisible <player.get_passenger> state:true
  - invisible <player.get_passenger.get_passenger> state:true
  - wait 3.5s
  - remove <player.get_passenger.get_passenger.get_passenger>
  - remove <player.get_passenger.get_passenger>
  - remove <player.get_passenger>

# DO NOT USE - WIP
# ChatMessageProcedure:
  type: procedure
  definitions: message
  script:
  - define <definition[message]> <definition[message].replace[cyan<&co>].with[\<cyan\>]>
  - define <definition[message]> <definition[message].replace[red<&co>].with[\<red\>]>
  - define <definition[message]> <definition[message].replace[blue<&co>].with[\<blue\>]>
  - define <definition[message]> <definition[message].replace[green<&co>].with[\<green\>]>
  - define <definition[message]> <definition[message].replace[dark_red<&co>].with[\<dark_red\>]>
  - define <definition[message]> <definition[message].replace[dark_blue<&co>].with[\<dark_blue\>]>
  - define <definition[message]> <definition[message].replace[dark_green<&co>].with[\<dark_green\>]>
  - define <definition[message]> <definition[message].replace[yellow<&co>].with[\<yellow\>]>
  - define <definition[message]> <definition[message].replace[gold<&co>].with[\<gold\>]>
  - define <definition[message]> <definition[message].replace[dark_yellow<&co>].with[\<gold\>]>
  - define <definition[message]> <definition[message].replace[purple<&co>].with[\<dark_purple\>]>
  - define <definition[message]> <definition[message].replace[magenta<&co>].with[\<light_purple\>]>
  - define <definition[message]> <definition[message].replace[light_purple<&co>].with[\<light_purple\>]>
  - define <definition[message]> <definition[message].replace[orange<&co>].with[\<orange\>]>
  - define <definition[message]> <definition[message].replace[underline<&co>].with[\<underline\>]>
  - define <definition[message]> <definition[message].replace[italic<&co>].with[\<italic\>]>
  - define <definition[message]> <definition[message].replace[gray<&co>].with[\<gray\>]>
  - define <definition[message]> <definition[message].replace[dark_gray<&co>].with[\<dark_gray\>]>
  - define <definition[message]> <definition[message].replace[black<&co>].with[\<black\>]>
  - determine <definition[message]>

 
 
 
 
 
 
 
 
 
 




Comments
No one has posted a comment! Post one below: