Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using MiNET;
  7. using MiNET.Plugins;
  8. using MiNET.Plugins.Attributes;
  9. using MiNET.Plugins.Commands;
  10. using MiNET.Entities;
  11. using MiNET.Blocks;
  12. using MiNET.BlockEntities;
  13.  
  14. namespace SetSignText
  15. {
  16. [Plugin(Author = "FDKPIBC",Description = "Set a Sign With Text",PluginName = "SetSignText",PluginVersion ="0.0.1")]
  17. public class SetSignText : Plugin
  18. {
  19. /// <summary>
  20. /// Set A Sign With Text
  21. /// </summary>
  22. /// <param name="player"></param>
  23. /// <param name="text1"></param>
  24. /// <param name="text2"></param>
  25. /// <param name="text3"></param>
  26. /// <param name="text4"></param>
  27. [Command]
  28. public VanillaCommands.SimpleResponse SetSign(Player player,string text1,string text2,string text3,string text4)
  29. {
  30. var postion = player.KnownPosition;
  31. Sign signentity = BlockEntityFactory.GetBlockEntityById("Sign") as Sign;
  32. signentity.Coordinates = postion.GetCoordinates3D();
  33. signentity.Text1 = text1;
  34. signentity.Text2 = text2;
  35. signentity.Text3 = text3;
  36. signentity.Text4 = text4;
  37. //broadcast sign to world
  38. player.Level.SetBlockEntity(signentity);
  39. return new VanillaCommands.SimpleResponse($"Create a Sign,x:{postion.X},y:{postion.Y},z:{postion.Z}");
  40. }
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement