Jump to content
  • Sign Up

AllergenX

Member
  • Content Count

    14
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by AllergenX

  1. Take some snack crackers, put ketchup on it. Then take a slice of pepperoni or hotdog and put it in the microwave.
  2. I think the goal here is pretty simple, I need to cancel an OnBlockChanging event. I have tried to set the variable "cancel" to true, but it doesn't seem to cancel the block being placed. Here's my code, if it is helpful: using System; using System.Collections.Generic; using System.IO; using MCGalaxy; using MCGalaxy.Events.ServerEvents; using MCGalaxy.Events.PlayerEvents; using MCGalaxy.Blocks.Extended; using BlockID = System.UInt16; using System.Reflection; using MCGalaxy.Tasks; namespace PluginAllersSurvival { public class AllersSurvival : Plugin { public override string name { get { return "AllersSurvival"; } } public override string MCGalaxy_Version { get { return "1.9.4.9"; } } public override string welcome { get { return "Thanks for using my plugin, Aller's Survival!"; } } public override string creator { get { return "AllergenX"; } } public static Dictionary<string, int> blockCounts = new Dictionary<string, int>(); // Called when this plugin is being loaded (e.g. on server startup) public override void Load(bool startup) { OnBlockChangingEvent.Register(OnBlockChanging, Priority.High); Player[] players = PlayerInfo.Online.Items; foreach (Player p in players) { blockCounts[p.DisplayName] = 0; } } // Called when this plugin is being unloaded (e.g. on server shutdown) public override void Unload(bool shutdown) { OnBlockChangingEvent.Unregister(OnBlockChanging); } public static void OnBlockChanging(Player p, ushort x, ushort y, ushort z, BlockID block, bool placing, ref bool cancel) { if (p.Level.Config.MOTD.Contains("+survival")) { if (placing == false) { blockCounts[p.DisplayName] = blockCounts[p.DisplayName] + 1; p.Message("You have " + Convert.ToString(blockCounts[p.DisplayName]) + " blocks."); } else { if (placing == true) { if (blockCounts[p.DisplayName] >= 1) { blockCounts[p.DisplayName] = blockCounts[p.DisplayName] - 1; p.Message("You have " + Convert.ToString(blockCounts[p.DisplayName]) + " blocks."); } else if (blockCounts[p.DisplayName] <= 0) { p.Message("You are out of blocks."); cancel = true; p.Message(Convert.ToString(cancel)); } } } } } // Displays help for or information about this plugin public override void Help(Player p) { p.Message("Super simple and awesome survival plugin."); } } } Yes, it messages me "You are out of blocks." and yes, it messages me "True".
  3. Fixed! Now it's // REQUIRES THE LATEST DEVELOPMENT BUILD OF MCGALAXY!!!!!!!!!!!!!!!!!!!!!!!!!!!
  4. Thank you SO MUCH! I'll definitely use these changes and info!
  5. I'd love constructive criticism on everything! This is my first plugin, so its probably not very great :) I also made them lowercase
  6. Hey there! I made a simple tone indicators plugin. All it does is it takes tone indicators like /j or /s among others, and puts a little tag, like [JOKING], in front of your chat message. You can find the source code for it here: https://github.com/AllergenStudios/MCGalaxy-Plugins/blob/main/ToneIndicators.cs Use it for whatever server you want, no credit required. If you use it on your server, it would be cool to comment your server name so I can check it out!
  7. I am trying to make a tone indicators plugin, where when people say something like '\j', it puts JOKING in their chat message But I can't figure out how to cancel events, since I don't want the player to send the chat message and instead have the server send it with the word "JOKING" in it. Here's my code incase needed: using System; using MCGalaxy; using MCGalaxy.Events.ServerEvents; using MCGalaxy.Events.PlayerEvents; namespace PluginToneIndicators { public sealed class ToneIndicators : Plugin { public override string name { get { return "ToneIndicators"; } } public override string MCGalaxy_Version { get { return "0.1"; } } public override string creator { get { return "AllergenX"; } } public override void Load(bool startup) { OnPlayerChatEvent.Register(HandlePlayerChat, Priority.High); } public override void Unload(bool shutdown) { OnPlayerChatEvent.Unregister(HandlePlayerChat); } static void HandlePlayerChat(Player p, string message) { if (message.Contains("\\j") == true) { // Cancel the event somehow // Ignore the rest of the code from this comment Chat.Message(ChatScope.Global, "&aJOKING", null, null, true); } } } }
  8. lol, I didn't know that that was a command, thank you!
  9. Using MCGalaxy, is there a command to set a permission for a command in a certain level? I want to make it so in every created realm (they are created using message blocks) in a server makes it so that anybody can use the /levelblock command in it. Help always appreciated :D
  10. If it's a terrain.png, there's a website called garbage.loan that is for hosting classicube resource packs and skins. You can then use /os map texture <the link you copied to the uploaded texture> in-game.
  11. (I don't know if I put this in the wrong place, but its not a help question or anything like that so I think this is the right place, correct me if I'm wrong!) There is a server named "iwasntfound server", when I joined I tried to use a /goto command since I couldn't find how to get back to the lobby. One of the "levels match" recommendations that popped up was just a giant world name with tons of bad words (not just swear words, worse than that, wont be repeating). And then they also used impersonate commands to make it look like people were saying some bad things as well. I don't know if this warrants being removed from the server list, but it probably does.
  12. I am trying to make a spleef gamemode, but am running into an issue. My goal is to use a message block with a cuboid command between two positions, and then fill it in with TNT. But it doesn't seem that it's possible to fill a cuboid with a command (like this: /cuboid tnt 0 0 0 20 20 20) Anyone know a way to achieve this goal? Help is appreciated :D
×
×
  • Create New...