#help-development
1 messages Β· Page 188 of 1
just a 5
please
nothing else
its arbitrary, its just a safe bet to delay it more than one tick
public Structure generateStructure(String name) {
World world = Bukkit.getWorld("world");
NamespacedKey key = new NamespacedKey(this, name);
Location loc = new Location(world, 0, 0, 0);
Structure newStructure = Bukkit.getStructureManager().createStructure();
newStructure.fill(loc, new BlockVector(16,-7,16), false);
Bukkit.getStructureManager().registerStructure(key, newStructure);
Bukkit.getStructureManager().saveStructure(key);
return newStructure;
}```
does this sesem right?
public void setMuted(OfflinePlayer p, boolean bool, long timewhenunban, String reason) {
try (PreparedStatement ps = c.prepareStatement("UPDATE players SET muted = ? WHERE uuid = ?;")) {
ps.setBoolean(1, bool);
ps.setString(2, p.getUniqueId().toString());
ps.executeQuery();
ps.close();
} catch (SQLException e){
Bukkit.getLogger().info(e.getClass().getName() + ": " + e.getMessage());
}
try (PreparedStatement ps = c.prepareStatement("UPDATE players SET muteDuration = ? WHERE uuid = ?;")) {
ps.setLong(1, timewhenunban);
ps.setString(2, p.getUniqueId().toString());
ps.executeQuery();
ps.close();
} catch (SQLException e){
Bukkit.getLogger().info(e.getClass().getName() + ": " + e.getMessage());
}
try (PreparedStatement ps = c.prepareStatement("UPDATE players SET muteReason = ? WHERE uuid = ?;")) {
ps.setString(1, reason);
ps.setString(2, p.getUniqueId().toString());
ps.executeQuery();
ps.close();
} catch (SQLException e){
Bukkit.getLogger().info(e.getClass().getName() + ": " + e.getMessage());
}
}``` is this how im meant to do it?
looks ok
you only need to do this once, just to convert your current schematic to a Structure
bruh
so this will save to a world file right?
it will create you a structure file in yoru world folder
is it working?
then test it and see
or that
Bro I got no clue what to type instead to make it 5 ticks
Please make the 30 seconds to 5 ticks.. so I can see what to do. π
look in your world folder, it shoudl be in there or a sub folder
all Structures are saved there by default
Hey is there a way to fix this error? This comes when you run the BuildTool.
Patching net\minecraft\world\level\WorldAccess.java
applyPatches.sh: line 2: $'\r': command not found
Rebuilding Forked projects....
applyPatches.sh: line 6: $'\r': command not found
applyPatches.sh: line 7: syntax error near unexpected token $'{\r'' applyPatches.sh: line 7: applyPatch() {
'
Error compiling Spigot. Please check the wiki for FAQs.
If this does not resolve your issue then please pastebin the entire BuildTools.log.txt file when seeking support.
java.lang.RuntimeException: Error running command, return status !=0: [sh, applyPatches.sh]
at org.spigotmc.builder.Builder.runProcess0(Builder.java:973)
at org.spigotmc.builder.Builder.runProcess(Builder.java:904)
at org.spigotmc.builder.Builder.main(Builder.java:703)
at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:27)
@eternal oxide i found it!!!
well done
{"stats":{"minecraft:used":{"minecraft:bedrock":31,"minecraft:yellow_terracotta":2,"minecraft:brown_mushroom_block":15,"minecraft:stripped_birch_wood":8,"minecraft:grass_block":200,"minecraft:polished_andesite":33},"minecraft:killed":{"minecraft:slime":4},"minecraft:custom":{"minecraft:jump":236,"minecraft:open_chest":1,"minecraft:time_since_rest":122992,"minecraft:damage_dealt":270,"minecraft:crouch_one_cm":122,"minecraft:leave_game":1,"minecraft:play_time":122992,"minecraft:sprint_one_cm":28436,"minecraft:time_since_death":122992,"minecraft:walk_one_cm":21950,"minecraft:sneak_time":593,"minecraft:total_world_time":122992,"minecraft:mob_kills":4,"minecraft:fly_one_cm":266899}},"DataVersion":3105}```
Wherever it was is the default save location
is that it?
If this does not resolve your issue then please pastebin the entire BuildTools.log.txt file when seeking support.
yey! but i dont have polished andesite nor grass block
im confused again
no
was I supposed to?
didnt name it
NamespacedKey key = new NamespacedKey(this, name);
yes, what was name?
No
you called the method generateStructure(String name)
what did you pass as the string?
hello there mateys. are you the man in control here @eternal oxide???!!!
ask your question if you have one please π
public Structure generateStructure(String name) {
World world = Bukkit.getWorld("world");
NamespacedKey key = new NamespacedKey(this, name);
Location loc = new Location(world, 0, 0, 0);
Structure newStructure = Bukkit.getStructureManager().createStructure();
newStructure.fill(loc, new BlockVector(16,-7,16), false);
Bukkit.getStructureManager().registerStructure(key, newStructure);
Bukkit.getStructureManager().saveStructure(key);
return newStructure;
}```
okay there matey
aint your matey, friend (please get it)
did you execute that code?
Idid
and what did you pass as name?
I didnt pass anything as name
You can;t call generateStructure without passing a name, so you must have given it one
this is what i have for the name ig
762847fe-0dd3-4270-a8df-60e02beaaac1.json
You are so confusing. Sometimes it seems as if you are quite good at Java, then you seem dumb as a brick π¦
where in your code did you call generateStructure ?
onenable
show me
I don;t see you executing that code at all
oh lamo
callback to this?
π
im trying to make my first plugin, i have this so far:
package org.bukkit.coolplugin
public class main extends JavaPlugin implements Listener {
@Override
public static void main(String[] args) {
Minecraft.sendMessage("Hello World!")
}
}
Spigot doesn;t use a main method
bruh what
?ask the question π
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
done
it wont let me compile, it says : JavaPlugin - Unknown
now compile, and run it once. it will create you a Structure file
I have:
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.8.8-R0.1-SNAPSHOT</version>
</dependency>
you also need the repository
Once you have a proper Structure file for "backrooms" save it somewhere as I know you are going to over write it by mistake
I l
use "spigot-api" instead of "spigot"
I love how you are so certain
i got it to work anyways
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId>
<version>1.8.8-R0.1-SNAPSHOT</version>
</dependency>
now it works
π
@eternal oxide it doesnt pop up
again, are you on intellij?
boy i love CB
what doesn;t popup?
I am using notepad at the moment and running it with cmd
well theres your problem
the structure file
use an IDE unless youre a masochist
If the code ran it created a Structure file
somewhere in your world folder
cannot install
Error occurred while enabling Backrooms v1.0-SNAPSHOT (Is it up to date?)
java.lang.NullPointerException: origin#getWorld() cannot be null
at java.util.Objects.requireNonNull(Objects.java:334) ~[?:?]
at org.apache.commons.lang3.Validate.notNull(Validate.java:224) ~[commons-lang3-3.12.0.jar:3.12.0]
at org.bukkit.craftbukkit.v1_19_R1.structure.CraftStructure.fill(CraftStructure.java:89) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3553-Spigot-14a2382-ef09464]
at backrooms.backrooms.Backrooms.generateStructure(Backrooms.java:63) ~[?:?]
at backrooms.backrooms.Backrooms.onEnable(Backrooms.java:50) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[spigot-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:342) ~[spigot-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:480) ~[spigot-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugin(CraftServer.java:523) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3553-Spigot-14a2382-ef09464]
at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugins(CraftServer.java:437) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3553-Spigot-14a2382-ef09464]
at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:225) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3553-Spigot-14a2382-ef09464]
at net.minecraft.server.MinecraftServer.v(MinecraftServer.java:966) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3553-Spigot-14a2382-ef09464]
at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:291) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3553-Spigot-14a2382-ef09464]
at java.lang.Thread.run(Thread.java:833) [?:?]``` π’
I dont even know what to say
what is the classpath lol:
backrooms.backrooms.Backrooms.generateStructure
follow a proper naming structure please
dont question it, theyll break it
invalid world name
its always been that way
Bukkit.getWorlds().get(0)
i set it to world
is your world called world?
is the main world on your server actually called world?
your error seems to disagree
it does not
I assume youre trying to load the world before it actually exists or is loaded
try delaying it
possibly
its worked for me before
a tick or 2 should work fine
if its called onEnable() thats at least part of the issue
move teh generateStructure("backrooms") to a player joining listener
that works
This si a LOT of work just to generate a structure where you are never going to use it again π¦
we just want the Structure file
ayo why does AttributeModifier need a uuid lmao
oh wait
ik why
i have my plugin load on start up
yeah, that will break it
Hi, Iβm currently learning how to use ACF (a command framework) but I have a doubt: does anyone know if each parameter of a command method represents an argument of the command inside the game?
@Subcommand("completions")
@CommandAlias("acfcompletions|acfc")
@Description("Test Completions")
@CommandCompletion("* * @test foo1|foo2|foo3")
public void onTestCompletion(CommandSender sender, OnlinePlayer player, World world, String test, String foo1, TestEnum e) {
sender.sendMessage("You got " + player.getPlayer().getName() + " - " + world.getName() + " - " + test + " - " + foo1 + " - " + e.name());
}
that would be basically /<basecommand> completions <player> <world> <test> <foo1> <e> right?
@eternal oxide
Error occurred while enabling Backrooms v1.0-SNAPSHOT (Is it up to date?)
java.lang.IllegalArgumentException: Size must be at least 1x1x1 but was 16x-7x16
at org.bukkit.craftbukkit.v1_19_R1.structure.CraftStructure.fill(CraftStructure.java:92) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3553-Spigot-14a2382-ef09464]
at backrooms.backrooms.Backrooms.generateStructure(Backrooms.java:63) ~[?:?]
at backrooms.backrooms.Backrooms.onEnable(Backrooms.java:50) ~[?:?]```
ok seems you can;t use negative vectors
shud i make posotive
so loc of 0,7,0 and vector of 16,7,16
not sure about the framework, an argument in the game is usually defined by having a " " that separates it from others
ok
the first CommandSender refers to the the sender, so not an arg, player, world, test, foo1 and e are all arguments or context resolvers if you defined them
So, somehow I'm fucking stupid. I'm trying to provide a local SQLite database, however compiling breaks the db file.
I know the original resource works, as well as the remote database but for some reason it gets corrupted on compile
https://github.com/OpticFusion1/MCAntiMalware/blob/master/MCAntiMalware-Core/pom.xml
so /command <player> <world> <test> <foo1> <e> yes
All right, thank you
thats alot of dependencies optic lol
If i want to temporarily change the inventory of a player, what would be the most elegant way?
I'm guessing it's something to do with the build section @tardy delta
@eternal oxide eyyyy
Save that somewhere else too, as a backup
doe
save their inventory in a variable or so and change it, then make sure the inventory is set back on both disable and player leave
done
done
As for the dependencies, they're all used actually @tardy delta π€£
now delete the calling code for generateStructure("backrooms") so it never gets called again
im going to save it for more schematics later on
glad they are
is that ok?
yes
That would require alot of checks, like when the player dies aswell, etc., is there a way to just make the player think he has a different set of items? (i just need to replace the items in the hotbar so he can quickswitch to them to select a setting)
im more progressive while coding in college than at home lol
not sure if you can do that with packets
ok doneeeeeeeeee
now uwt
wut
so there is no way to do it with spigot api alone?
discord-webhooks & jlibnotify for extra notification methods.
influxdb for the remote & local db (the project I've talked about before will get rid of the use of SQLite databases entirely however)
snakeyaml because it's a third-party jar and it's the best for .yml files
asm because it's needed to do what's needed for scanning
jopt for the CLI args, and the rest are for other misc things
not that I'm aware of
but that does not fix my actual issue lmao
okay
SQLite database gets malformed on compile
Your next job is...
- implement the void world code you were given earlier. So you can generate a void world.
- add a ChunkLoadEvent Listener
- in the Listener Bukkit.getScheduler().runTask( () -> { ... }
In 3 you need to paste your Structure using Bukkit.getStructureManager().loadStructure(new NamespacedKey(this, "backrooms").place(...
You actually only need to load the Structure once. So you can do that in a Field
then simply reference it when you need it
every time a Chunk loads you check isNewChunk and if true place Structure
Is there a way to send a player to a server with the console of one of the paper servers
to a different server like with my plugin
I want to use a console command of my paper server that is in a bungee network to send the player to a different server
Try using Java 17
code looks messy
Worldguard api is confusing
String::repeat confusing too
Are there any ways to color ones name tag/glowing effect other than scoreboard teams?
Hello everyone! Tell me how to implement the ability to write system messages on behalf of the plugin using hex colors.
I have a plugin and it its a spigot plugin on a paper server in a bungeecord (waterfall) network. I want to move the player from the server that the plugin is on to the server called "survival". I have looked up some things online and they talk about messaging the bungeecord proxy. I have done what they said and this is what I have.
In an @EventHandler:
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF("Connect");
out.writeUTF("survival");
In the onEnable():
this.getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
In the onDisable():
this.getServer().getMessenger().unregisterOutgoingPluginChannel(this);
It does not send the player to the survival server when the event is called. Can anyone tell me why? (I just started to learn how to do this so it's probably a super dumb mistake.)
Here, I need to replace the standard color codes with hex.
I tried to implement it this way, but idea complains:
I am trying to differentiate different types of the same mob, for example two zombies that do different numbers of damage. At first I was going to differentiate them using NBT tags but I couldn't find any tags that would serve this purpose. I thought of using the CustomName tag but I do not want it to show above the head, and I couldn't find a way to make it invisible. Is there any way to hide custom names? Or perhaps another way of differentiating different types of the same mob?
tldr; How do I differentiate different types of the same mob, for example two zombies that do different numbers of damage
pretty sure you need to import the other ChatColor
the one from bungee
Bungee? This is the first time I've heard about it
there are 2 different chatcolor enums
import the one that contains bungee in the path
no
I don't have that
the NamespacedKey should be a constant, as should the Structure
Last time I did it using the PlaceHolder Api plugin. But I decided to try to do it myself and then I ran into a problem. A lot of forums talk about how to make players write using hex colors, and I need to make a system message with hex color.
@EventHandler
public void OnRPStatus(PlayerResourcePackStatusEvent event) {
if (event.getStatus() == PlayerResourcePackStatusEvent.Status.SUCCESSFULLY_LOADED |
event.getStatus() == PlayerResourcePackStatusEvent.Status.ACCEPTED){
event.getPlayer().sendMessage("Work!");
} else {
event.getPlayer().kickPlayer(ChatColor.RED + "Test message"));
}
}
you only load the Structure once at startup
tf?
You only schedule a task if event.isnewChunk()
is this a thing?
primitives can't be null
oh
If someone can explain to me how it works, then I will be very grateful!
should i use the other form of float?
Hmm, I'll take a look now
|| not |
I'm blind π Thank you, I found it
And another question. Is there any way to simplify the installation of hex colors? For example, through the grid #
you probably can, just google hex to rgb or something like that
i've found a fun way to mess with the game
registering illegal items
through nms
private static final Pattern HEX_PATTERN = Pattern.compile("#[a-fA-F\\d]{6}");
public static String colorizeWithHexSupport(String input) {
Matcher matcher = HEX_PATTERN.matcher(input);
while (matcher.find()) {
String hexColor = input.substring(matcher.start(), matcher.end());
input = input.replace(hexColor, net.md_5.bungee.api.ChatColor.of(hexColor).toString());
}
return ChatColor.translateAlternateColorCodes('&', input);
}
will be able to translate "#abc123" or however its written
Okay, thanks
bump
I want to change a player skin head (the one in the Tab next to the name of the player), I'm using TAB plugin, and I need to recreate this using respective API
package com.marqus.cubicscoreboard;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitScheduler;
import org.bukkit.scoreboard.*;
public final class CubicScoreboard extends JavaPlugin implements Listener {
@Override
public void onEnable() {
Bukkit.getPluginManager().registerEvents(this, this);
}
@EventHandler
public void onJoin(PlayerJoinEvent e) {
Player player = e.getPlayer();
createBoard(player);
}
@Override
public void onDisable() {
// Plugin shutdown logic
}
public void createBoard(Player player) {
BukkitScheduler scheduler = Bukkit.getScheduler();
scheduler.runTaskLater(this, () -> {
ScoreboardManager manager = Bukkit.getScoreboardManager();
Scoreboard board = manager.getNewScoreboard();
Objective obj = board.registerNewObjective("FangeBoard", "dummy");
obj.setDisplaySlot(DisplaySlot.SIDEBAR);
obj.setDisplayName(ChatColor.translateAlternateColorCodes('&', "&a&lCUBIMC &8- &f&lPRISON"));
Score name1 = obj.getScore(ChatColor.translateAlternateColorCodes('&', "&7Dit navn &8Β»"));
name1.setScore(3);
Score space = obj.getScore("");
space.setScore(2);
Score name = obj.getScore(ChatColor.translateAlternateColorCodes('&', "&a" + player.getName()));
name.setScore(1);
player.setScoreboard(board);
Bukkit.broadcastMessage("Mooooo!");
}, 5);
}
}
The scoreboard is not showing up?
@eternal oxide so
The runnable has to be in a e.isNewChunk if statement??
Show code
And why do you expect it to be null
Tag me in your response or i wonβt open this server to see it
bumping this if anyone has any idea
?pdc
was about to say that
Thank you!
russian
Block#setType?
How would I get something from my my plugins config from one of my event listeners in another file?
I'm using getServer().getPluginManager().registerEvents(new OnPlayerJoinListener(), this);
to load my event listener (where OnPlayerJoinListener is in another file)
but I cant seem to figure out how to get something from the config outside of the main file (where i'd use something like getConfig().getString("CONFIG_EXAMPLE_VAR");) which has the extends JavaPlugin on the class.
my OnPlayerJoinListener class line looks like public class OnPlayerJoinListener implements Listener {
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
Use that
Thank you β€οΈ
pls answer
gettingg an error here:
any fixes?
trying to generate a bukkit NBT file into the world
And the error is?
Ah itβs a compiler error
I doubt that class extends JavaPlugin
it extends chunkgenerator
So you canβt just use this when making a namespaced key
so (plugin) this?
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
I have a plugin and it its a spigot plugin on a paper server in a bungeecord (waterfall) network. I want to move the player from the server that the plugin is on to the server called "survival". I have looked up some things online and they talk about messaging the bungeecord proxy. I have done what they said and this is what I have.
In an @EventHandler:
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF("ConnectOther");
out.writeUTF(event.getWhoClicked().toString());
out.writeUTF("survival");
In the onEnable():
this.getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
In the onDisable():
this.getServer().getMessenger().unregisterOutgoingPluginChannel(this);
It does not send the player to the survival server when the event is called. Can anyone tell me why? (I just started to learn how to do this so it's probably a super dumb mistake.)
Hello
how can i create a inventory that contains all blocks
excluding some blocks
and another for the swords, pickaxes and thhat
i tried by adding every block with a loop but doesn't worked
You'd need to paginate
Are there any like normal SQL types where you don't have to specify the size / is there a reason I should be specific about size of the type
I'm making a database api to interlope multiple databases through one abstraction and it'd be weird to have these specific types for just SQL
public static String BINARY(int length) {
return ("BINARY(" + length + ")");
}```
For example you have stuff like this, but that doesn't really fit well with the nosql db's i've used
You need to be specific to prevent something bigger than what you want going in
π€ okay SQL makes my brain hurt lol. Curious its size in bytes right?
π why can't sql just have normal types these are all so weird
for example I don't get what the purpose of varbinary would be if binary exists
you specify the size for both so what would make varbinary "variable"
backwards compat? idk
do you use SQL? if so I'd be curious what types you support or whatever cuz my brain can't comprehend why I should support all of these just for SQL
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
I mainly write SQL
what types are you like generally using as a standard
I shouldn't have learned mongo before sql this makes my brain explode
like do you even ever use varchar and varbinary or like tinyblob
I use varchar, double, boolean (tinyint I or something like that) and a host of others when I need them
why use varchar versus char
is there a reason
varchar for variable length, TEXT is pref if you don't care about input size. However, that does mean your DB can be stuck loading big text data
And you don't really want to use char
Unless you don't care about storage usage
A VARIABLE length string (can contain letters, numbers, and special characters). The size parameter specifies the maximum string length in characters - can be from 0 to 65535```
This is what w3schools says about varchar but what makes this so insanely different than text to me they seem similar
Holds a string with a maximum length of 65,535 bytes```
TEXT doesn't have the constraints you can slap onto VARCHAR by default
SQL was written so that other developers can't ruin your day as easily
but you can limit the size of both text and varchar
hmmm honestly this makes me think I'll deal with basic object types on a per database impl so probably have like AbstractDatabaseType or sum and then put logic in there
why are you looping through online players, and you forgot ) in the end
hmmm so from what i've gathered so far SQL is extremely declarative in the sense you always know whats being put into your tables and they are defined right away so there is no deviation from the format
though whats the difference between server types and mysql data types. I'm using sqlite for my project is there some like standard for SQL that would be SQL Server Types or something?
Yes, you need to have everything built yourself
is there any possible way to make an wither entity with its invulernable ticks set to be damagable? i have tried to set it to be not invulernable but no dice... any suggestions ?
You might have to make an NMS entity for it.
yea i have an nms entity for it,
public CustomWither(Level world)
{
super(EntityType.WITHER, world);
setInvulnerableTicks(500);
setSilent(true);
setInvulnerable(false);
this.setHealth(this.getMaxHealth());
this.bossEvent.setProgress(1.0F);
this.bossEvent.setVisible(false);
}
@Override
protected void customServerAiStep()
{
this.setInvulnerable(false);
}
@Override
protected void registerGoals()
{
//this.goalSelector.addGoal(1, new RangedAttackGoal(this, 1.0D, 40, 20.0F));
//this.targetSelector.addGoal(2, new NearestAttackableTargetGoal(this, LivingEntity.class, 0, false, false, LIVING_ENTITY_SELECTOR));
this.goalSelector.addGoal(1, new LookAtPlayerGoal(this, Player.class, 8.0F));
this.goalSelector.addGoal(2, new RandomLookAroundGoal(this));
}
public void move(double d0, double d1, double d2)
{
return;
}
How do I get a bukkit color from a hex color code?
what i am trying to do is make a mini wither that is able to be damaged, right now i can't seem to find a way to do that
Bukkit has Color#fromRGB(), so you could do Color.fromRGB(0xFFFFFF); (or whatever you want for your colour code)
Unless you want a ChatColor, in which case you'll have to use BungeeChat's ChatColor.of(int)
https://pneumonoultramicroscopicsilicovolcanoconiosis.club/MxdLG0AX Is it possible to remove the background of the armor stand tag with a texture pack?
probably not
Possibly
π€
With shaders
shaders might help yeah
:/
i don't think tag background is texture
You could definitely do some finagling with some shaders, yeah. Not entirely sure how you would distinguish between a tag and other elements though. At least with the scoreboard it's pretty distinguishable.
People do all sorts of weird things
Iβve seen a shader to remove the tooltips on items by detecting massive tooltips
okay, I was hoping there was a way to do it with just a texture pack but I guess not. thanks :)
I mean shaders are part of a texture pack
How can I send a player text and if they click said text, they execute a command
Using the component api
I told him to use teh listener to get it working, IF he has his void worldgen setup
You are getting closer
first make make a Field Structure backroom; and in your onEnable backroom = Bukkit.getStructureManager().loadStructure(new NamespacedKey(this, "backrooms");
cant figure out why this isnt working...
says its invalid however is the exact same as the string "earth"
ik the command itself is being called because ofc it returns "earth is not a valid element." to the chat
Clearly, you are not the Avatar. Also use equals() not ==
maybe i dont know how equals() works cause it keeps giving me errors
probably formating it wrong lemme google rq
yea i was
Arrays.asList(βblablaβ, βblebleβ).contains(args[0])
this worked already^
@raw prairie Once you have your field set your Structure is available to use. in your runnablejava Location loc = new Location(e.getWorld(), e.getChunk().getX() * 16, 7, e.getChunk().getZ() * 16); backroom.place(loc, false, StructureRotation.NONE, Mirror.NONE, 0, 1, new Random());
anyone know why on PlayerToggleSneakEvent, the event.isSneaking true on both toggles of sneak? wouldnt it be false at least once?
It shoudl be false once
Your code.
cant see what could be wrong with it
when shift and when release
it says was true
that should only say "was true" when releasing
Call isSneaking when event is called lmao.
The event fires before it toggles
i just deleted and retyped it the same way, and it worked so i assume i was just dumb and forgot to save it
however the iscanclled one isnt working (lemme just double check if i saved it lul)
yeah ig event.isCancelled() is always false π€·ββοΈ
at least whilst sneak event is called lul
i guess i can just do if !event.isSneaking()
it will always be false unless you change it
isCancelled is only true if some plugin sets it
alr gotcha
hello
8b6619f9-f9a5-3bd6-8842-712369e22e19:
linkid: 8501
b719f8ed-aa9d-39c1-84f6-1f68d14ce985:
linkid: 8015
My config is like this
i want to access every uuid on the config
how can i do that
i mean like
for(UUID uuid: config....){}
getKeys(false) on the configuration section
IS uuid a string?
ah actually when we text it its being string
dumbrain
^ If you need it as a string. Just use the toString() method and it will work fine
it just returns one
for(String bum: PlayerDiscordData.getConfig().getKeys(true)) {
/*if(linkID.getAsInt() == PlayerDiscordData.getConfig().getInt(bum)) {
}*/
event.reply(bum).queue();
}```
b719f8ed-aa9d-39c1-84f6-1f68d14ce985:
linkid: 248
8b6619f9-f9a5-3bd6-8842-712369e22e19:
linkid: 3866
``` This is the config
Ah actually
its an error of JDA
it cant reply for reps
uhm how can i get values directly
PlayerDiscordData.getConfig().getInt(bum + ".linkid") Will return the int
im trying to take player from Bukkit.getPlayer(UUID);
but it keeps returning null
to get a Player they must be online
it is
they are logged in?
yes
then your UUID is wrong
Show the full code you're using the for it. The bit where you are using getPlayer
are you passing that as an actual UUID Object or a String?
if (event.getChannel().equals(event.getGuild().getGuildChannelById("1031799536592629824"))) {
for (String bum: PlayerDiscordData.getConfig().getKeys(false)) {
if (PlayerDiscordData.getConfig().getIntegerList("numbers").contains(linkID.getAsInt())) {
if (linkID.getAsInt() == PlayerDiscordData.getConfig().getInt(bum + ".linkid")) {
event.reply(bum).queue();
event.getChannel().sendMessage("8b6619f9-f9a5-3bd6-8842-712369e22e19").queue();
Player p = Bukkit.getPlayer("8b6619f9-f9a5-3bd6-8842-712369e22e19");
Member m = event.getMember();
event.reply("BaΕarΔ±yla isminizi deΔiΕtirdim...").queue();
m.modifyNickname(p.getName()).queue();
}
}else {
event.reply("ID YOK").queue();
}
}```
Strin
g
then you are not getting by UUID
you are askign for a player named "that string"
there is no player named "8b6619f9-f9a5-3bd6-8842-712369e22e19"
how can i cast a string to uuid
UUID.fromString
there is also no player with that uuid apparently unless you're playing cracked
Got it thanks
Hi everyone! How to make it so that if you click on the chest with an item from an item stack, it will close and it will only open with this item and so that it cannot be opened with the same item but with a different name
hi, I have a question ... I have a hub with spigot and obviously a bungee connected ... I am learning to do pl bungeecord and therefore, I was told that for a pl for example for the hub I have to do it entirely in bungee, but can I put the bungee pls in the plugins folder of the hub in spigot? otherwise what's the point, I can't put it in the bungee otherwise it affects all modes
I have to do them in bungee for connections to modes
with compass
bungee plugins are plugins that work directly on the proxy. if you only want to have a plugin running on the hub, you would install it as normal plugin on the spigot hub server
but when i did clean package jars were scattered everywhere
plugins made for bungee need to run on bungee, plugins made for spigot need to run on spigot. they are not "interchangable", e.g. bungee plugins do not run on spigot and vice versa
You cna however create a dual plugin which runs on both. but it's basically two plugins in one
yeah but that's still two plugins, just thrown into one .jar
oop lmfao
and how do I create a spigot plugin and put a compass that leads to interaction with a bungre server
you need to use plugin messaging, or your own form of inter-server communication (e.g. redis)
?messaging
hm
?pmc
just google "bungeecord plugin messaging" or similar
beware, it's quite annoying
I'd rather use redis
but that requires a redis server, ofc
Thank you bro
what is the compass going to do btw?
a gui to teleport across servers?
in that case, make it a spigot plugin that creates a usual GUI, and when you click on e.g. the item for "pvp", then you can send a simple plugin message to the bungee server with "Connect" message: https://www.spigotmc.org/wiki/bukkit-bungee-plugin-messaging-channel/#connect
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
so, no bungee plugin needed in this case
You mean a key?
yep
there's Lockable#setLock(String) but that would make it "openable" with every item named like this
Same shiet
except that nbt requires nms
You know what I meant lmao
i thought you meant plain NBT tags lol
is it possible to change echest slot by nms? or its fixed?
size
You don't really need nms
You can just open a chest inventory with the api
And save the inventory in a pdc
I don't want to cancel event and create new GUI.
but want to change the real echest size.
is that possible somehow?
You can fork Spigot if you want that
so not possible with plugin?
If you don't want to reopen an inventory then no
Hi again! how can I get that if the player clicked on the RMB block along with the shift
rmb?
package com.marqus.cubicscoreboard;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitScheduler;
import org.bukkit.scoreboard.*;
public final class CubicScoreboard extends JavaPlugin implements Listener {
@Override
public void onEnable() {
Bukkit.getPluginManager().registerEvents(this, this);
}
@EventHandler
public void onJoin(PlayerJoinEvent e) {
Player player = e.getPlayer();
createBoard(player);
}
@Override
public void onDisable() {
// Plugin shutdown logic
}
public void createBoard(Player player) {
BukkitScheduler scheduler = Bukkit.getScheduler();
scheduler.runTaskLater(this, () -> {
ScoreboardManager manager = Bukkit.getScoreboardManager();
Scoreboard board = manager.getNewScoreboard();
Objective obj = board.registerNewObjective("FangeBoard", "dummy");
obj.setDisplaySlot(DisplaySlot.SIDEBAR);
obj.setDisplayName(ChatColor.translateAlternateColorCodes('&', "&a&lCUBIMC &8- &f&lPRISON"));
Score name1 = obj.getScore(ChatColor.translateAlternateColorCodes('&', "&7Dit navn &8Β»"));
name1.setScore(3);
Score space = obj.getScore("");
space.setScore(2);
Score name = obj.getScore(ChatColor.translateAlternateColorCodes('&', "&a" + player.getName()));
name.setScore(1);
player.setScoreboard(board);
Bukkit.broadcastMessage("Mooooo!");
}, 5);
}
}
My sidebar isn't showing up, no errors in the console (Paper 1.8)
interact event, RIGHT_CLICK_BLOCK with Player#isCrouching()
right mouse button
thanks
is it possible to make all mobs angry at you, even the passive ones
is the minecraft weather command entirely unable to run from console?
no world component, so no
damn it
just use the API
this was a workaround for scripting weather commands
I'm guessing setting time is the same
iirc essentials has a weather command and time command with world properties so you could just depend on essx
How can you modify NBT Data of an entity? Does anyone know?
no plugins AT ALL?
that discord message looks like a plugin
its a bungee plugin
could be a bungee plugin making you not able to chat then
can i send full list of pls?
pl
welcome to the club lol
not as far as im aware
this is truly one of the APIs of all time
it do be an api
if only we had the tech to do it any other way
theres gotta be a good reason why they dont
I think it's just legacy code, like some of the parts of the chunk-related api
Guys i need help with CrackShot plugin:
In the Explosion section, when i change the explosion radius, it doesn't go over 4 blocks of radius (minecraft default). As i know the radius of Crackshot explosions can go over 4 blocks, but i don't know why it doesn't work on my server. This is the Explosions configuration:
Explosions:
Enable: true
Enable_Owner_Immunity: true
Damage_Multiplier: 95
Explosion_No_Grief: true
Explosion_Radius: 20
On_Impact_With_Anything: true
Explosion_Delay: 20
Sounds_Explode: FUSE-4-2-0
As you can see, i set the radius at 20, but it doesn't work, it remains on the default radius. Please help
ask the plugin dev
go onto the plugin's page and message them
Guys what should be entered in lockable.setLock();
declaration: package: org.bukkit.block, interface: Lockable
why are you registering a new recipe each interact
because I need the result Key and in another place if I enter it, then I have an error
what error
Cannot resolve symbol 'Key'
Well, I look at the docks and see that I need a key, but what can be considered a key here
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
import org.bukkit.block.Lockable;
import org.bukkit.block.data.BlockData;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.persistence.PersistentDataContainer;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;
public final class Keys extends JavaPlugin implements Listener {
private static Keys plugin;
FileConfiguration config = this.getConfig();
public Keys() {
}
@Override
public void onEnable() {
plugin = this;
this.getConfig().options().copyDefaults(true);
Bukkit.getServer().getPluginManager().registerEvents(this,this);
saveConfig();
ShapedRecipe recipe = new ShapedRecipe(NamespacedKey.minecraft("Key"), Key);
recipe.shape("GG ", "GG ", " G ");
recipe.setIngredient('G', Material.GOLD_INGOT);
Bukkit.addRecipe(recipe);
}
@EventHandler
public void Event(PlayerInteractEvent e) {
Block chest = e.getClickedBlock();
Player p = e.getPlayer();
String KFCL = "This is just key";
String KFC = "Key";
ItemStack Key = new ItemStack(Material.TRIPWIRE_HOOK, 1);
ItemMeta meta = Key.getItemMeta();
String name = p.getName();
meta.setDisplayName(name + "" + KFC);
List<String> lore = new ArrayList<>();
lore.add(KFCL);
Key.setItemMeta(meta);
ShapedRecipe recipe = new ShapedRecipe(NamespacedKey.minecraft("Key"), Key);
recipe.shape("GG ", "GG ", " G ");
recipe.setIngredient('G', Material.GOLD_INGOT);
Bukkit.addRecipe(recipe);
if (e.getAction() == Action.RIGHT_CLICK_AIR && e.getClickedBlock().getType() == Material.ANVIL && p.getInventory().getItemInMainHand() == Key) {
e.setCancelled(true);
}
BlockData blockData = chest.getBlockData();
if (e.getClickedBlock().getType() == Material.CHEST && e.getAction() == Action.RIGHT_CLICK_BLOCK && p.isSneaking() && p.getInventory().getItemInMainHand() == Key) {
if (chest instanceof Lockable) {
Lockable lockable = (Lockable) blockData;
lockable.setLock();
}
}
if (e.getClickedBlock().getType() == Material.CHEST && e.getAction() == Action.RIGHT_CLICK_BLOCK && p.isSneaking() && p.getInventory().getItemInMainHand() == Key) {
if (chest instanceof Lockable) {
Lockable lockable = (Lockable) blockData;
lockable.setLock(null);
}
}
}
@Override
public void onDisable () {
// Plugin shutdown logic
}
public static Keys getPlugin() {
return plugin;
}
}
i would really recommend just using pdc instead
I just need if the name is for example Key1 then I close the chest with it and another key for example Key2 could not open it
its much ebtter than the Lockable interface
like i said, use pdc and generate a uuid instead
Lockable does it for you, you just need to assign a name
Hello, I am currently dealing with nms entities and their goal selectors
I have a problem where I set up a PathfinderGoalBowShoot, but the custom entity doesn't shoot the arrow, only charges and then stops charging when it should fire, but no arrow :(
I am
ACF doubts
BookMeta bookMeta = (BookMeta) libroScritto.getItemMeta();
bookMeta.setTitle("Test");
bookMeta.setAuthor("Test");
List<String> pagine = new ArrayList<String>();
pagine.add("Hi 1\n\n Hi 2\n\n Hi 3");
bookMeta.setPages(pagine);
writtenBook.setItemMeta(bookMeta);```
I Get an error with this code, anyone?
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[server.jar:3096a-Spigot-9fb885e-af1a232]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:149) ~[server.jar:3096a-Spigot-9fb885e-af1a232]```
?paste it. I feel like there's more to that error
At the bottom. There's your problem
Array index out of bounds
Oh, where?
Where it tells you the error?
If you don't know how to read a stack trace I highly suggest learning
Oh, I've see
I think you should call the shoot method from the entity, idk because I never worked with pathfinders before
hm okay, but currently I have another problem xD
I want to change the attack speed of my custom entity
and there is literally nothing useful in the forums
does someone know how I can change the attack speed of a custom nms entity?
(with pathfinder goals?)
show code
public class EntityBody extends EntityVindicator implements IRangedEntity {
public EntityBody(EntityTypes<? extends EntityVindicator> entityType, World worldServer, Location location) {
super(entityType, worldServer);
getBukkitEntity().setPersistent(true);
this.craftAttributes.getAttribute(Attribute.GENERIC_FOLLOW_RANGE).setBaseValue(100);
b(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
}
@Override
public void u() {
bS.a(0, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true));
bS.a(1, new PathfinderGoalHurtByTarget(this, Entity.class));
bS.a(2, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 1.5f));
bS.a(3, new CustomPathfinderGoalMeleeAttack(this, 1.25, true));
//bS.a(3, new PathfinderGoalBowShoot<>(this, 1, 20, 10));
}
@Override
public void a(EntityLiving arg0, float arg1) {
super.a(arg0, arg1);
}
}
The shoot goal is //bS.a(3, new PathfinderGoalBowShoot<>(this, 1, 20, 10));
whys it commented out
because it doesn't work xD
i tested it and the vindicator already charged, but is doesnt shoot the arrow when uncharging
How can i add pathfinder goals to entityhuman?
what is startUsingItem and performRangedAttack?
I think entityhuman doesn't have a pathfinder
remapped namings
you cant
so what citizens does
but you can do a hidden entity and tp the npc to the entity
they did their own pathfinder
then that hidden entity acts as a pathfinder
there is a better alternative
yeah but way harder
you can create an entity, send a destroy packet and create a player on this id
ah
and the server will animate the player
You can just do a funky move
like the entity
didnt even think that would work lol
which is a funky trick used in some minigame servers
create a villager with a custom name (or some other entity)
And whenever any packet is sent for the entity, you just cancel it out and send your own
So you can replace all spawn packets with a player spawn with the viewer's own skin
so i do my pathfinding stuff with a zombie
despawn it with packet
and spawn an npc with the id in the packet parms as the zombie packet?
You don't need to despawn if you never spawn it
yeah but it needs to pathfind right?
just rewrite minecraft's server code from the ground up and make your own entity system
thats a better alternative
you could just theoretically intercept the spawn packet
and replace it with oyur own with the same entity id
right?
rather than despawning it
so i addWorld the zombie
intercept the spawn packet
check if the id is the zombie
change the id field to the HumanEntity's id field
obfuscated nms is fun nms
one question about mapping: can I export my projects the normal way then?? like without having to change the mappings everytime?
doesn't player spawning use like 4 spawn packets
by everytime do you mean each version change?
i mean, each time i export the project
and i can send the other packets after intercepting the actual spawn packet
If you're a masochist absolutely it is
you need the maven plugin
all it does is translate moj mappings to nms
if thats what you're asking
someone is going to pay me to code a plugin so an npc with a girl npc spawns and runs from you
dont I also need to run buildtools?
tf fr
for the intial dependency, yes
ofoofooff
who needs a plugin, i can just go outside
pov: I take off my mask
is there like an online browser for mapping translations?
pov: dream
dude even has a mask in his pfp
exactly what i needed! :D now i just have to find a way to change a static final field :D
what for?
there is a variable for the time until next attack
and i must change this to something lower to allow more attacks/second
do you know how I can change a static final field?
unsafe
:)
Field unsafeField = Unsafe.class.getDeclaredField("theUnsafe");
unsafeField.setAccessible(true);
Unsafe unsafe = (Unsafe) unsafeField.get(null);
...
I did it here
I don't think you can change the value of a final field if you're using 17+
unsafe allows it
reflections don't
unsafe literally lets you mess with RAM pointers directly
what is the import?
Had to do some weird constructor reflection stuff for records as they have final fields :/
and then?
unsafe.putObject
weird, i dont have that option
might be something with eclipse
eclipse once hid the whole awt from me
okay, eclipse did :D
but what are those offsets
putObject(Object o, long offset, Object x)
o, offset and x?
Hmm Ye there is Unsafe.getUnsafe()
How can I set this nbt {EntityTag:{Invisible:1b}} to a item frame in the players inventory? .getItemMeta() etc is clear but how can I set this nbt?
Pretty interesting
Entity tags dont work with itemstacks
When would you ever use that
I can give an Item Frame with a command to the player. (/give @p item_frame{EntityTag:{Invisible:1b}} 1)
Idk just Nice to know
this is an itemframe that is invisible as soon as you place it
it throws a security exception
so you gotta access it via refleciton
ironic
Ye read that
Pre much a sneaky throws ig
Ye
you can get the object offset from the field
If you ever wanted to fuck up memory
unsafe.objectFieldOffset(Field)
Use something like nbt api
Or look at the sec and replicate
Or google
yes, i managed to do it
Day 0275382825 of asking for pointers
package com.marqus.cubicscoreboard;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitScheduler;
import org.bukkit.scoreboard.*;
public final class CubicScoreboard extends JavaPlugin implements Listener {
@Override
public void onEnable() {
Bukkit.getPluginManager().registerEvents(this, this);
}
@EventHandler
public void onJoin(PlayerJoinEvent e) {
Player player = e.getPlayer();
createBoard(player);
}
@Override
public void onDisable() {
// Plugin shutdown logic
}
public void createBoard(Player player) {
BukkitScheduler scheduler = Bukkit.getScheduler();
scheduler.runTaskLater(this, () -> {
ScoreboardManager manager = Bukkit.getScoreboardManager();
Scoreboard board = manager.getNewScoreboard();
Objective obj = board.registerNewObjective("FangeBoard", "dummy");
obj.setDisplaySlot(DisplaySlot.SIDEBAR);
obj.setDisplayName(ChatColor.translateAlternateColorCodes('&', "&a&lCUBIMC &8- &f&lPRISON"));
Score name1 = obj.getScore(ChatColor.translateAlternateColorCodes('&', "&7Dit navn &8Β»"));
name1.setScore(3);
Score space = obj.getScore("");
space.setScore(2);
Score name = obj.getScore(ChatColor.translateAlternateColorCodes('&', "&a" + player.getName()));
name.setScore(1);
player.setScoreboard(board);
Bukkit.broadcastMessage("Mooooo!");
}, 5);
}
}
My sidebar isn't showing up, no errors in the console (Paper 1.8)
paper 1.8
Im sending Hex Message to player, but I want to implement Hover/Click Event on it as well.
If I do so, those colors change to Bukkit ones.
Any ideas how to fix that?
?
How are you parsing the hex
It should work fine
Hey I'll imported CraftBukkit to acces NMS and things such as CraftEntity and more. But it is not working does someone know if there are any errors with CraftBukkit 1.19 or smth?
Use spigot
Not craftbukkit
?paste
?bt
doesnt spigot have some really weird translate hex thing'
But I need CraftBukkit to acces the NMS system?
I mean I have spigot
Use the spigot import
No spigot
Not spigot-api
Just spigot
Okay
How are you making the clickable message
Using component builder should work fine with hex
TextComponent component = new TextComponent(Event.getPlugin().getMessagesConfig().getColor(color) + color);
HoverEvent he = new HoverEvent(HoverEvent.Action.SHOW_TEXT
,TextComponent.fromLegacyText("test"));
component.setHoverEvent(he);
sender.spigot().sendMessage(component);
I'm trying to add hex color formatting to OnePlayerSleep's sleep messages (https://www.spigotmc.org/resources/oneplayersleep.76534/).
using...
Check this out
works great
thx
Ask in #help-server
can i send the datapack there or-
signs are client based right? so you can't easily use them as UI right?
You actually can use them as a GUI
oh, how? i googled for a while now and didn't find anything really helping...
You'd need to use packets to open the screen
And packets to intercept when they save the sign
I'll see if I can find a guide in a bit
oke, but first: i need a text input for a link to a picture, so it should be able to store as much text as possible. also, i don't want to use the chat, so what's the best solution? i'm not sure if signs are the right thing if they're a bit complicated but things such as an anvilinventory are much more limited at text lenght, right?
i found this for sending packages to open the sign, but how to read the input on close?
public static void open(Player player, int x, int y, int z) {
try {
Class<?> packetClass = getNMSClass("PacketPlayOutOpenSignEditor");
Class<?> blockPositionClass = getNMSClass("BlockPosition");
Constructor<?> blockPosCon = blockPositionClass.getConstructor(new Class[] { Integer.TYPE, Integer.TYPE, Integer.TYPE });
Object blockPosition = blockPosCon.newInstance(new Object[] { Integer.valueOf(x), Integer.valueOf(y), Integer.valueOf(z) });
Constructor<?> packetCon = packetClass.getConstructor(new Class[] { blockPositionClass });
Object packet = packetCon.newInstance(new Object[] { blockPosition });
sendPacket(player, packet);
} catch (Exception e) {
}
}
Signs have a lower limit than anvils, no?
jeha, per line limit is much smaller
but also an anvil isn't enough, so i have to search something else
i also tried with books, but i think there's no way to send packages for opening and reading content of writable books
I'm getting this when remapping... I have updated everything to Java version 19 but am still getting this error
How do I get colored glass like this in 1.8:
Material.STAINED_GLASS_PANE
your jdk version is too old
add a byte param
How do I do that?
either that or the maven version is too low
How can I check the maven version
mvn -version
I'm not gonna answer basic java questions
How can I add a plant to the farmland block (I don't mean setType)?
Bruhh
the plant belonging on a farmland is just the block above it
[17:48:41 ERROR]: Could not pass event PlayerInteractEvent to CubicVagt v1.2
org.bukkit.event.EventException: null
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302) ~[patched_1.8.8.jar:git-PaperSpigot-445]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:78) ~[patched_1.8.8.jar:git-PaperSpigot-445]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[patched_1.8.8.jar:git-PaperSpigot-445]
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:517) [patched_1.8.8.jar:git-PaperSpigot-445]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:502) [patched_1.8.8.jar:git-PaperSpigot-445]
at org.bukkit.craftbukkit.v1_8_R3.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:228) [patched_1.8.8.jar:git-PaperSpigot-445]
at net.minecraft.server.v1_8_R3.PlayerInteractManager.interact(PlayerInteractManager.java:463) [patched_1.8.8.jar:git-PaperSpigot-445]
at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:763) [patched_1.8.8.jar:git-PaperSpigot-445]
at net.minecraft.server.v1_8_R3.PacketPlayInBlockPlace.a(PacketPlayInBlockPlace.java:52) [patched_1.8.8.jar:git-PaperSpigot-445]
at net.minecraft.server.v1_8_R3.PacketPlayInBlockPlace.a(PacketPlayInBlockPlace.java:1) [patched_1.8.8.jar:git-PaperSpigot-445]
at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13) [patched_1.8.8.jar:git-PaperSpigot-445]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_312]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_312]
at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44) [patched_1.8.8.jar:git-PaperSpigot-445]
at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:774) [patched_1.8.8.jar:git-PaperSpigot-445]
at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:378) [patched_1.8.8.jar:git-PaperSpigot-445]
at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:713) [patched_1.8.8.jar:git-PaperSpigot-445]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:616) [patched_1.8.8.jar:git-PaperSpigot-445]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_312]
Caused by: java.lang.ArrayIndexOutOfBoundsException: 45
at org.bukkit.craftbukkit.v1_8_R3.inventory.CraftInventoryCustom$MinecraftInventory.setItem(CraftInventoryCustom.java:104) ~[patched_1.8.8.jar:git-PaperSpigot-445]
at org.bukkit.craftbukkit.v1_8_R3.inventory.CraftInventory.setItem(CraftInventory.java:79) ~[patched_1.8.8.jar:git-PaperSpigot-445]
at com.cubicmc.cubicvagt.events.SignInteract.onPlayerInteract(SignInteract.java:75) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_312]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_312]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_312]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_312]
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:300) ~[patched_1.8.8.jar:git-PaperSpigot-445]
... 18 more
package com.cubicmc.cubicvagt.events;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.block.Sign;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import java.util.Arrays;
public class SignInteract implements Listener {
@EventHandler
public void onPlayerInteract(PlayerInteractEvent e) {
Player player = (Player) e.getPlayer();
if(e.getClickedBlock() == null)return;
if(e.getClickedBlock().getState() instanceof Sign){
Sign sign = (Sign)e.getClickedBlock().getState();
if(sign.getLine(0).equalsIgnoreCase(ChatColor.translateAlternateColorCodes('&', "&5&lWARP"))) {
Inventory VagtWarp = Bukkit.createInventory(player, 45, ChatColor.translateAlternateColorCodes('&', "&8[ &5&lVAGT &8- &f&lWARP &8]"));
// C Main vagt stue
ItemStack cmain = new ItemStack(Material.WOOD_BUTTON);
ItemMeta cMainMeta = cmain.getItemMeta();
cMainMeta.setDisplayName(ChatColor.translateAlternateColorCodes('&', "&c&lC STOR VAGTSTUE"));
cMainMeta.setLore(Arrays.asList(ChatColor.translateAlternateColorCodes('&', "&7 \n &7Teleport til &cC &7stor vagtstue \n &7 \n &7&o(( Klik her for at teleportere! ))")));
cmain.setItemMeta(cMainMeta);
VagtWarp.setItem(19, cmain);
// C Vagt-events vagtstue
ItemStack cVagtEvent = new ItemStack(Material.WOOD_BUTTON);
ItemMeta cVagtEventMeta = cVagtEvent.getItemMeta();
cVagtEventMeta.setDisplayName(ChatColor.translateAlternateColorCodes('&', "&c&lC LILLE VAGTSTUE &8( &c1 &8)"));
cVagtEventMeta.setLore(Arrays.asList(ChatColor.translateAlternateColorCodes('&', "&7 \n &7Teleport til &cC &7stor vagtstue \n &7 \n &7&o(( Klik her for at teleportere! ))")));
cVagtEvent.setItemMeta(cVagtEventMeta);
VagtWarp.setItem(20, cVagtEvent);
// C Vault vagtstue
ItemStack cVaultStue = new ItemStack(Material.WOOD_BUTTON);
ItemMeta cVaultStueMeta = cVaultStue.getItemMeta();
cVaultStueMeta.setDisplayName(ChatColor.translateAlternateColorCodes('&', "&c&lC LILLE VAGTSTUE &8( &c2 &8)"));
cVaultStueMeta.setLore(Arrays.asList(ChatColor.translateAlternateColorCodes('&', "&7 \n &7Teleport til &cC &7stor vagtstue \n &7 \n &7&o(( Klik her for at teleportere! ))")));
cVaultStue.setItemMeta(cVaultStueMeta);
VagtWarp.setItem(21, cVaultStue);
// FRAME - LILLA
ItemStack frame = new ItemStack(Material.WOOD_BUTTON);
for (int i : new int[]{0,1,2,3,4,5,6,7,8}) {
VagtWarp.setItem(i, frame);
}
// FRAME - HVID
ItemStack frame2 = new ItemStack(Material.WOOD_BUTTON);
for (int i : new int[]{36,37,38,39,40,41,42,43,44,45}) {
VagtWarp.setItem(i, frame2);
}
player.openInventory(VagtWarp);
// e.getPlayer().sendMessage(ChatColor.translateAlternateColorCodes('&', "&8[ &5&lCUBICMC &8- &f&lVAGT &8] &7Dette virker!!"));
}
}
}
}
Whats wrong, the gui isn't opening
consider using a ?paste for that much code
for (int i : new int[]{36,37,38,39,40,41,42,43,44,45}) {```
tf is this? lol
manual loop between range
Something is trying to use Java 18. Check your build settings
shitty trick but it owrks
Since you're using Intellij open project settings and make sure to set the JDK version there
why not simply i = 36; i <.... ++
Could it be something to do with the way I built BuildTools?
is it faster?
don't question him
hm xD
it's worse in every way possible
No I don't think so
there's a much better way to structure this but that comes with experience and I'm not gonna bother making his project for him
true
properties tag isn't used anymore for setting the version
For example the shade plugin
unless you using eclipse
what about ms-paint-ide
What is used instead?
configuration tag like you have for the maven compiler plugin
although you don't have to use the maven compiler plugin specifically to set the version, just a plugin that accepts such configs
I'm building with Java 17 now and still getting the same problem
Hello, I have a question. How can I make a floating block. I used the "BlockPhysicsEvent" and canceled it but my block still broke. I watched how work the ropeladder in WorldGuard and the code seems similar to what I do. So I don't understand how they do that. (I want to create a floating sign).
are you certain that the java version being used is the one you think is being used?
try doing java -version
on the ide terminal
Yeah says 17.0.4.1
It must be something to do with the remap plugin
I don't know how to change the Java version on that thouugh
major version 62 is java 18, which is saying it doesn't support
https://paste.md-5.net/gajoliweyi.xml this is what I have for the remap plugin
would have to use java 17 or lower
maybe its something to do with the openjdk version you are using
have you tried using a different version?
I'll try using IBM's one
well might be sufficient to use openjdk 18 or 17
Have you never been new at Java?
where naming conventions
I always understood basic concepts like method, field, parameter and basic naming conventions
before I ever wrote any java code
learnt in college how to create object today π
You start with the minimum and expand your knowledge by learning about classes and implementations as you go
we were supposed to have a programming test
half of the time im just watching the news or smth
on paper today
meanwhile other courses
had a mad anxiety attack, stood still for like 40 minutes
My semester project is a reverse proxy with bot filtering in nodejs and I'm sitting here in the actual js class having to learn how to create an object
teacher noticed me, asked to speak outside and just let me go
test about fuckin SQL queries
learning sql this year too
learnt a new few things but idk if those are postgres specific
I didn't even get anxious about the test
but on my way to the test, I got in from the back gate
and a teacher caught me on my way to the test and started questioning how I got the code
wait wha
and then that teacher appeared on the fuckin classroom and just stood there staring for the entire test duration
talkin to the programming teacher
i have a test thrusday about basic java concepts
poor illusion β€οΈ
its like 2 hours but can be done in 20 minutes
got some ice cream
and then played basketball
DROP TABLE dual;
then had some gymnastics class where I just did like some 5 acrobatic positions and passed
and chilled
learnt things like select column::numeric(10,2)
no
no
looks unsettling
oh ok
Terrible teaching
what an ugly animal
that's my dog..
poor dog
WHAT THE FUCK
basically we all have standards
If your PE teacher isn't drafting you into the military is he really a PE teacher
teacher is cool
made us run like 30 laps
I was the only one wearing a mask
almost passed out
Bruh
I remember we had to run a few miles and anyone who fell behind lost points and the less points you got the less you got graded
your doing college?
I'm most definitely using Java 17 to compile this but still getting the error
So we were sitting there running in the mud for a few miles
it's a weird HS mix
Good Times
lol
I'm not that old
Huh
pretty sure that I can define it with a number
he was talking about an old teacher
Apparently this defense doesn't stand in court
69 or 70 their bones will still crack
I think something like "Due to electrons repelling other electrons atoms never actually really touch, so no officer, I did not hit that girl" will also not work
Court fr tryna frame us all
what the fuck
?
1.8 π€‘
purple I thought that EP was 1.19+
fun
get workin
woah that's crazy bro
I hate you
Lmao
F
Nice
lmao
You know something!
wait, that's not 18M instances of NetworkManager, that's an inner π
smh
Whereβs this
it's spark heapsummary
lambda or smth
just look at the amount of bytes and byte arrays used in lighting
anyone wanna date?
eh no you smell
π
ok
bro that's not 18M instances, that's 18M packets being sent
cri
time to track packets!
Most here would just tell you to use mojang mappings lol
Mojang Mappings on top
Prob just better off sending the code and waiting who knows
are you sure its packets?
I've even built BuiuldTools in Java 17
The only JDK I have is Java 17
And all of my settings are set to Java 17
What could I possibly be doing wrong
Yeah, it's this being ran, queuing packets
so its 18m instances of channefuture then
How can I do this
idk how to do it on intelliJ as I don't use it
but I am sure there is someone here who does
Maybe my JDK version is too high
well that was what I was hinting at
...
wtf lol
10.4m packets of entities teleporting
yeah lmaoo
might want to check what is going on there lol
ahah
never really seen that really except maybe some large server
that is literally the only thing that is consuming the most for whatever reason, all the rest is within reasonable limits
except playerinfo amirite
lmao
not me owo
owo
what's wrong with OutPlayerInfo
time to track where Teleport is being created from!
only if they move more then 8 blocks
1 tick
ah i was thinkin about jumpin 8 block far
ah
Anyone know how I'd find and cancel a bundle spilling its contents onto the ground after rightclick?
found it
Found out it just uses the PlayerDropItemEvent, one event for every dropped itemstack individually.
Yeah that looks to be the only way.
Thanks
hey mathematicians