Skip to content

Instantly share code, notes, and snippets.

@chunrapeepat
Created January 19, 2019 02:55
Show Gist options
  • Save chunrapeepat/6cd61b0158a64ed448e92fd7cc9c275a to your computer and use it in GitHub Desktop.
Save chunrapeepat/6cd61b0158a64ed448e92fd7cc9c275a to your computer and use it in GitHub Desktop.
Create Minecraft Plugin - CodePlearn
# Trigger, Events & String (Hello World)
on click:
the clicked block is a bedrock
message "§aHello World, I'm §l%player%"
# Custom Command (/car - Riding a horse)
command /car:
executable by: players
trigger:
spawn a horse at player
equip last spawned entity with a saddle
make the player ride last spawned entity
# /kill <entity> kill all that entity with Loop
command /kill [<entity type>]:
executable by: players
trigger:
if arg 1 is not set:
message "Please defined entity type."
exit trigger
loop all entities:
loop-entity is arg-1:
kill loop-entity
# Variable (Global vs Local)
command /setmsg <text>:
executable by: players
trigger:
set {message} to arg 1
command /getmsg:
executable by: players
trigger:
message "Your message is %{message}%"
# Variable
command /sethome:
executable by: players
trigger:
set {home.%player%} to player's location
command /home:
executable by: players
trigger:
if {home.%player%} is not set:
message "<red> You must set your home first."
exit trigger
teleport player to {home.%player%}
# The Project (Thor Hammer)
command /thor:
executable by: players
trigger:
if {enabled} is true:
set {enabled} to false
else:
set {enabled} to true
message "<green>Thor mode has been set to %{enabled}%"
on click:
clicked block is solid:
if {enabled} is true:
strike lightning at clicked block's location
create a fake explosion at clicked block's location
cancel event
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment