Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import:
- java.lang.Runnable
- org.bukkit.plugin.PluginManager
- org.bukkit.Bukkit
- org.bukkit.event.EventHandler
- org.bukkit.event.EventPriority
- org.bukkit.event.player.PlayerInteractEvent
- org.bukkit.event.block.Action
- org.bukkit.event.Listener
- options:
- bukkitSrv: Bukkit.getServer()
- on right click:
- if event-player's held item is book:
- set {_p} to event-player
- set {_craft} to getCraftFromPilot({_p})
- set {_target_sign} to uncoloured display name of event-player's held item
- set {_hitbox} to {_craft}.getHitBox()
- set {_world} to {_craft}.getW()
- set {_signs::*} to getSignsInHitBox({_hitbox}, {_world}, "%{_target_sign}%")
- loop {_signs::*}:
- set {_b} to loop-value
- wait 2 ticks
- set {_ForceClickSign} to new PlayerInteractEvent("%{_p}%" parsed as offline player, Action.RIGHT_CLICK_BLOCK, Material.AIR, {_b}, (facing of {_b}))
- wait 2 ticks
- {@bukkitSrv}.getPluginManager().callEvent({_ForceClickSign})
- #Trying to force the player to click a block, and execute some code.
Advertisement
Add Comment
Please, Sign In to add comment