Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using MiNET;
- using MiNET.Plugins;
- using MiNET.Plugins.Attributes;
- using MiNET.Plugins.Commands;
- using MiNET.Entities;
- using MiNET.Blocks;
- using MiNET.BlockEntities;
- namespace SetSignText
- {
- [Plugin(Author = "FDKPIBC",Description = "Set a Sign With Text",PluginName = "SetSignText",PluginVersion ="0.0.1")]
- public class SetSignText : Plugin
- {
- /// <summary>
- /// Set A Sign With Text
- /// </summary>
- /// <param name="player"></param>
- /// <param name="text1"></param>
- /// <param name="text2"></param>
- /// <param name="text3"></param>
- /// <param name="text4"></param>
- [Command]
- public VanillaCommands.SimpleResponse SetSign(Player player,string text1,string text2,string text3,string text4)
- {
- var postion = player.KnownPosition;
- Sign signentity = BlockEntityFactory.GetBlockEntityById("Sign") as Sign;
- signentity.Coordinates = postion.GetCoordinates3D();
- signentity.Text1 = text1;
- signentity.Text2 = text2;
- signentity.Text3 = text3;
- signentity.Text4 = text4;
- //broadcast sign to world
- player.Level.SetBlockEntity(signentity);
- return new VanillaCommands.SimpleResponse($"Create a Sign,x:{postion.X},y:{postion.Y},z:{postion.Z}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement