#help-development
1 messages Β· Page 617 of 1
what
something like:
public void set(String key, Object value) {
// inserts that key into the database
}
thats basically how any database works
is anyone here ever worked with quest plugins
?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!
Hello, how can I check if a Biome is any ocean ?
why does nametagedit have to use reflection π
Hey, which algorithms can complete an online player's name given a wrong input?
I don't just want completion based on prefix(notc -> notch) but also for example the input of Ntc should return Notch if Notch is online
too difficult to bother with
check if a string contains every letter from user's input
That's a nice start but I know it's a hard problem. I'm looking for a modern and known algorithm
ie if I type ihrroen should it return yoru name as a match?
I get your point. What I expect in 90% of the cases where the input is wrong, it's wrong in max 1-2 characters
they could be missing or mistyped
I suggest you match for all characters and order by weight
y2k
Is there a known algorithm that does that?
I just need the name of it
if people misspell then its their problem
I think the same, but it's for a paid plugin so I can't refuse lol
ofc I can refuse, but I don't because there has to be an algorithm for this
its called TypoMatching
whats up
spigot water or tap water
I usually just get water out of my fridge
Tap water is soyboy behaviour
if (newItemEditor.getEnchants().keySet().stream().anyMatch(enchantment -> enchantment.conflictsWith(currentEnchant))) {
Logger.log("Nie moge");
continue;
}```
Why it is true when i try to combine item with prot 1 and another item with prot 1?
No errors.
is there a simple way to add glowing effect to a block itemstack?
Enchant it and then hide enchantments
if u create a custom enchant u can aply it and it willl be invisible
I mean I guess you can do that too
Logger.log(Enchantment.PROTECTION_ENVIRONMENTAL.conflictsWith(Enchantment.PROTECTION_ENVIRONMENTAL));```
wtf why this is true?!
Why not
i mean you cant have the same enchantment twice
oh tihs answer is better
but i can combine them but o know waht u meant
yeah this is just a general function saying that the enchantments cannot exist on something at once
how could I limit maximal height when lauching player via Vector?
I don't want him to go to the heavens but still go to the point, that's higher than the start location
Limit the y value
Is there an Method to generate (vanilla[-api]) Structures during World-Creation without waiting for complete generation ?
Hey guys, using NMS mojang mappings and getting this error at run-time, no error compile time. Anyone know what it might be?
Exception Msg
java.lang.NoClassDefFoundError: net/minecraft/world/entity/player/Player
at CharacterCard-1.0-SNAPSHOT.jar//charactercard.charactercard.CharacterCard.onEnable(CharacterCard.java:66)
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:279)
at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:192)
at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:104)
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:507)
at org.bukkit.craftbukkit.v1_19_R2.CraftServer.enablePlugin(CraftServer.java:560)
at org.bukkit.craftbukkit.v1_19_R2.CraftServer.enablePlugins(CraftServer.java:471)
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:635)
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:434)
at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:308)
at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1101)
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.ClassNotFoundException: net.minecraft.world.entity.player.Player
at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:183)
at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:150)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
... 13 more
how do i take the sql statements out of the main thread loop?
Which output-jar do you use ? seems like your using the wrong mapped jar
show ur code
search for async scheduler
There is a CharacterCard-1.0-SNAPSHOT.jar that I am using. There is also a original-CharacterCard-1.0-SNAPSHOT.jar
is there no other ? like ###-remapped or ###-remapped-obf ?
There is not. These are my dependencies in pom.xml. Is there something else I should be doing in the pom to get the extra jars?
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.19.3-R0.1-SNAPSHOT</version>
<classifier>remapped-mojang</classifier>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.comphenix.protocol</groupId>
<artifactId>ProtocolLib</artifactId>
<version>4.8.0</version>
</dependency>
</dependencies>
did you added the "plugin"-part in the pom ?
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>16</source>
<target>16</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
something like this
That seems to be the part I am missing
Hello, how can I get the server simulation distance ?
how about "Bukkit.getSimulationDistance()" ?
okay thanks
?nms
All working now. Thanks!
Does anyone know a way to change a file name if it's already in use by a process?
or is that impossible to do?
@Override
public boolean perform(Player player, String[] args) {
AtomicBoolean return_value = new AtomicBoolean(false);
try {
Bukkit.getScheduler().runTaskAsynchronously(Hcfcore.getInstance(), () -> {
try {
if (FactionManager.playerInFaction(player.getUniqueId())) {
if (FactionManager.isPlayerLeader(player.getUniqueId())) {
player.getInventory().addItem(ClaimWand.makeNewWand());
player.sendMessage("You have recieved a claim wand!");
return_value.set(true);
return;
}
player.sendMessage("You must be leader to be able to claim!");
return_value.set(true);;
return;
}
} catch (SQLException e) {
e.printStackTrace();
player.sendMessage("SQL ERROR! CONTACT DEVELOPER ASAP.");
}
player.sendMessage("You are not in a faction. Create one with /f create [name]");
}
).wait();
} catch (InterruptedException e) {
e.printStackTrace();
}
return return_value.get();``` is this the right way to prevent it from clogging the main thread?
all the stuff from FactionManager run sql tasks
why do you use .wait() ?
to wait for it right?
but thats why your main thread is waiting O.o
im not used to java async
π yeah just realized
remove it ^^
so everything should be fine if i take out the wait
i guess so
alright thanks
Anyone know?
if its used you cant change the name
if you remove .wait() value of value of return_value.get() will always be false
you can create a copy and then rename the copy and later remove the used file
yeah thats what i thought
ah alright. I'll just have to change the way the class works then
Got it thanks :)
thats too much java for me
you most likely don't want to block main thread :p
yo Goksi
how does this look?
@Override
public @Nullable CompletableFuture<PlayerData> getData(@NotNull Player key) {
return CompletableFuture.supplyAsync(() -> {
UUID uuid = key.getUniqueId();
String SQL = "SELECT * FROM players WHERE uuid=?";
try (Connection conn = connection.getConnection().join()) {
PreparedStatement statement = conn.prepareStatement(SQL);
statement.setString(1, uuid.toString());
try (ResultSet result = statement.executeQuery()) {
if (result.next()) {
Player player = Bukkit.getPlayer(result.getString("uuid"));
return (PlayerData) new GenPlayer(player);
}
}
return null;
} catch (SQLException e) {
throw new RuntimeException(e);
}
}).exceptionally(e -> {
e.printStackTrace();
return null;
});
}```
How can i set blocks without light updates
I do the world.setBlock(pos, state, integer)
And i can see light updates happening
drop it in the plugins folder
Bukkit.getPlayer(String) will look player by name. Also why do you rethrow runtime exception just to call .exceptionally later, just printStackTrace and return null inside of catch block
ah okay
yeah my bad
Help
lol why for player you use data class
I mean, you don't get anything besides the player, do you?
ah i see
))
i was think this container
someone say me how add plugin in spigotMc site i not see button
oh i see
who know how update my plugin
i want delete end add another update version
idk alex
where exactly do you want me to click
not really obvious from that screenshot
I think it means there is an Earthquake emanating from the "Post Resource Update" button
so we click this?
Anything I could improve here? There has to be
https://github.com/Outspending/InvoiceGens/blob/main/common/src/main/java/me/outspending/invoicegens/sql/SQLHandler.java
I just need more practice with Futures
Humble object principle
import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;
public class MinecraftClient {
public static void main(String[] args) throws IOException {
Socket socket = new Socket("localhost", 25565);
OutputStream output = socket.getOutputStream();
// Send the handshake packet.
byte[] handshake = new byte[25];
handshake[0] = 0x00; // Protocol version
handshake[1] = 0x00; // Server address length
handshake[2] = 0x00; // Server address length
System.arraycopy("localhost".getBytes(), 0, handshake, 3, "localhost".length());
handshake[11] = 25565; // Server port
handshake[12] = 0x00; // Next state
handshake[13] = 0x01; // Encryption enabled
output.write(handshake);
// Send the join request packet.
byte[] joinRequest = new byte[24];
joinRequest[0] = 0x01; // Packet id
joinRequest[1] = 0x00; // Length
System.arraycopy("world".getBytes(), 0, joinRequest, 2, "world".length());
output.write(joinRequest);
}
}```
Does minecraft protocol work like that? ^
just asked bard to write it lol
in spigot, how to play a sound AT a location but so ALL players can hear it, so its not directly sent to the player??
get location of player and play sound on that location not to player
example please?
declaration: package: org.bukkit, interface: World
player.getLocation().playSound() something like that
Use the method I sent
i am trying its saying it cant resolve it
It exists
Show ur cofe
^^
Code
Location loc = dead.getLocation().clone().add(0,0.9,0);
int roleInt = getIntVariable(killer,"roleInt");
switch (roleInt) {
case 1:
playSound(killer.getLocation(), Sound.ENTITY_FIREWORK_ROCKET_TWINKLE, 1.0f, 0.0f);
for (int i = 0; i < 10; i++) {
new Fragment(null, loc, new Vector(0, 1, 0), "firework1");
}
return;
default:```
killer.getLocation().playSound
dead*
World.getWorld("world").playSound
Won't work
player#playsound or World#playSound
They want world#playSound
Get the world from the players location
Player has a getWorld() method
anyone who knows mc protocol here?
?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!
just ask your question instead of a question for the question
i already asked. lmao
^
Then bump the question instead of asking pointless other questions
or open a thread
So what are you trying to do
i think it worked , thanks a lot!
trying to make bard write mc client
lol
@charred blaze there was someone doing what you are tyrying to do. he used to have a name like bettanation or something
ah
I can;t remember what name he has now
From your code it looks like you are tryign to fake login a player
yeah first of all fake login
his reason was to keep the server active for messaging channels
??
you can;t send messages to a server that has no players logged in
PMC
for teh life of me I can;t remember his nick though
Why does calling block.getType() asynchronously cause a freeze?
because the world will try to load sync or generate sync i guess
Does anyone know of someone who could develop a Minecraft task with NPCs and a built environment that I could use for a research project? I would pay
post that in forums
probably something for the forums
Thanks!
Damn π
Wtf
Never knew java was the 5th fastest programming language
That's nice
- Zig
- Rust
- C
- C++
- Java
Sick
uh source please
Hello, what are the coordinates (relative to the player) of his back ?
(I want to spawn a ItemDisplay on his back)
player.getLocation().subtract(player.getLocation().getDirection().multiply(0.5)) then +1 to Y
okay thanks π
I there anyway i can make JSON not look dog crap on the forums?
ik theres a highligh for java
and yaml
but no json
json is a subset of yaml
Maybe there is something wrong... I want it to be perpendicular to player direction
Location locationItem = player.getLocation();
locationItem.subtract(player.getLocation().getDirection().multiply(0.5));
locationItem.add(0, 1, 0);
player.getWorld().spawn(locationItem, ItemDisplay.class, (itemDisplay) -> {
itemDisplay.setItemStack(previous);
});```
ohhhh
thanks x)
I want to do something like that https://www.curseforge.com/minecraft/mc-mods/back-tools
Cool
how can I set an offset ? x)
okay thanks
Rust is not faster than C
they are close, but rust is undoubtedly slower
why isn't python on number one ?!
it is, its just still running sort on the list
Tf is zig
Wanted to ask same
its some new C competetor iirc
Does it also compile to assembly
no clue
Looks like I can't do something myself...java itemDisplay.setTransformation(new Transformation(new Vector3f(-.5f, 1f, -.5f), new Quaternionf(), new Vector3f(), new Quaternionf()));The entity is far away from me, I can't see it 
did you set it as a passenger?
yes
player.addPassenger(player.getWorld().spawn(player.getLocation(), ItemDisplay.class, (itemDisplay) -> {
itemDisplay.setItemStack(previous);
itemDisplay.setTransformation(new Transformation(new Vector3f(1f), new Quaternionf(), new Vector3f(), new Quaternionf()));
}));```
also rather than creating all those new objects you may want to use getTransformation() and adjust the vec3f
is it good ?java Transformation transformation = itemDisplay.getTransformation(); transformation.getTranslation().set(-.5f, 1, -.5f); itemDisplay.setTransformation(transformation);
probably
Seems fine...
i need a code to place blocks without lite update and physics
Pretty sure itβs just Block#setType(type, false)
that does lighting updates, just no physics
not really 

why do you ask this in help-development?
Wehre should i ask this?
lmao

my bad
How can I compare a player head texture to another texture or not?
((SkullMeta) itemStack.getItemMeta()).getOwnerProfile().getTextures()
well, how can I do it? I have this :java transformation.getTranslation().set(-.5f, 0, -.5f);and the result is:
it shoudl be relative to the player so not both x and z
get the skin / url, then check if they are equal()?
so I need to get player direction vector ?
Need to separate URL to https?
not sure in teh case of a passenger
wdym?
does it always ride in teh same position as you move?
its always the same orientation
Hi,
I am working on a plugin where the player has a score that can change multiple times a minute.
I want to store the score in a MySQL database but doing a request multiple time a minute for each player would be inefficient.
I think I should store it somewhere else and update the database when the player log off or when the server stop.
How should I store the data temporarily ?
as you move the player the sword follows?
seems its not riding
it's set as a passenger, but it's not following me
(it's following me)
@last temple Okay, thank you
but not getting my direction
Do I just need to compare this part?
not sure what you mean
see
It wonβt rotate as your rotate
why don't you just compare the URL object you can retrieve from the Textures object with equals() ?
Youβd have to manually handle that
using player yaw ?
Sure
yep probably
the problem is that idk where I need to set it
PlayerMoveEvent
I will compare it to a texture in the config file
to change the direction of the passenger ?
If we compare it with the URL, unnecessary parts such as https come with me, right?
just set its offset depending on player direction
well...
its just getDirection, modify and apply to teh vec3f
I'll try to set the offset correctly when it spawns first, and after I'll do this with playerMoveEvent, getting the entities nearby the player and modifying the good itemdisplay
what do I need to modify ?
This ?java transformation.getTranslation().set(player.getLocation().getDirection().toVector3f());
half getDirection as a negative
okay should i do?
@Override
public @Nullable Unregisterable register(@NotNull Registerable key) {
List<UnregisteredGenerator> registerables = getUnregisteredGenerators();
if (registerables.contains(key)) {
RegisteredGenerator registeredGenerator = new RegisteredGenerator(key);
getRegisteredGenerators().add(registeredGenerator);
registerables.remove((UnregisteredGenerator) key);
return registeredGenerator;
}
return null;
}```
or
```java
@Override
public @Nullable Unregisterable register(@NotNull Registerable key) {
if (unregisteredGenerators.contains(key)) {
RegisteredGenerator registeredGenerator = new RegisteredGenerator(key);
registeredGenerators.add(registeredGenerator);
unregisteredGenerators.remove((UnregisteredGenerator) key);
return registeredGenerator;
}
return null;
}```
since im using unregisteredGenerators twice
how π
please
there is absolute
but not the inverse of absolute
oh it's negate
@eternal oxide maybe there is something inside this
https://github.com/iChun/BackTools/blob/master/src/main/java/me/ichun/mods/backtools/client/model/BacktoolModel.java
JavaPlugin already contains a "getConfig()" Method with a different return type. You are overriding it with another return type which is not allowed
I think error is pretty self explanatory
Changing the name of the function is enough
class plugin yikes
Maybe its a new keyword, they know sth we donβt
Does Plugin() still counts as constructor of plugin class lol
sometimes i put main(String[] args) in non-app jars just to tell them "This is not an application"
whats the best way to transfer (send) messages throughout servers? (im using redis but i couldn't figure it out)
Hi,
I posted a question a bit earlier and the answer was to use a Hashmap to store data onto the player like that : Hashmap<UUID, Integer>
Is there any specific reason why I shouldn't use Hashmap<Player, Integer> ?
probably something regarding memory leaks by holding a reference to the Player instead of just their UUID
since even if the player leaves ur still holding a reference to them that (i believe?) can not be garbage collected
if the player leaves and rejoins, it's a new player object
pubsub
Oh I see, thank you @buoyant viper and @tender shard you are both really kind to answer my questions
You can also just slap the int in their pdc
i oughta start thinkin of something to use PDCs for on my smp tbh
I use them in nearly everything now
im just uncreative lolz
do you have a Map<Material,List<double[]>> somewhere?
no?
Custom item? PDC
Custom block? PDC
Custom entity? PDC
alright,
Redis Output looks like this:
onPMessage pattern __key*__:* __keyevent@0__:set notify
And this is for the message
String[] split = message.split("set");
String first = split[0];
first = first.trim();
GuildChatMessageHandler.getInstance().handle(fetch the player, message);
Am i right?
oh i know what i can use PDCs for
settings persistence for log stripping in my smp plugin
oops wrong output
just slap a boolean onto that bad boy
uuuh no clue what you're talking about lol
Log striping persistence?
had to look at wtf i even store for players
like if right clicking w an axe strips or not
That's a nice feature
Ah
dont mind the absolutely insane code for sitting on an armor stand btw
whats insane about that
idk
then dont mention it
what is insane though is how EntityDismountEvent is part of Spigot API and not Bukkit
since i am too stupid to find a bukkit event regarding dismounting from entities besides VehicleExitEvent
does it matter though
yesn't
like no server just runs naked bukkit anyways
Who still depends on the Bukkit api
spigot
Okay well other than that
paper
just weird that it isnt standard bukkit, maybe it existed before spigot acquired it
A lot of stuff did get moved from spigot into Bukkit
// Plugin startup logic
Sadly a bit is still in spigot
// Plugin shutdown logic
my first tracker used PlayerToggleSneakEvent
but for some reason it kept bugging on me so i rly needed a different event
ngl i think i straight up looked at the GSit plugin and had saw the event existed under spigots package LOL
I hate enderpearls
you failed to show the full error, so no clue.
my guess is, that library requires java 11 or 17 but you're still on java 8
my bet is no repository
Not verified? Upload screenshots here: https://prnt.sc/
my guess is, that library requires java 11 or 17 but you're still on java 8
yeah
however no clue if that's really the issue, you haven't sent the full maven log
no repo
its on central
it is?
This works
<dependency>
<groupId>io.github.cdimascio</groupId>
<artifactId>dotenv-java</artifactId>
<version>2.3.2</version>
</dependency>
ah ok
Thanks
np. next time you should just read the readme of the libraries you're using lol
is PlayerQuitEvent still called on server shutdown or should I just do a loop through all players
it does work, you're just using it wrong / did not include or create an .env file
But i have?
Hello, how can I set a ItemDisplay in the back of the player ?
no, it's not called
What event checks for when a Totem of Undying is used?
where?
ahh thank you. I was trying to do player before lol.
note that this event is always called on death, but it'll be cancelled if they dont have any totem
thats stupid
Called when an entity dies and may have the opportunity to be resurrected. Will be called in a cancelled state if the entity does not have a totem equipped.
do i have to handle this or can i let it go?
well I think it makes sense, it's more like an "attempt to resurrect" event. and you can uncancel it to e.g. create additional items similar to totems
sab :( I undastand tho
just add ignoreCancelled = true to your event handler annotation
theyll resurect?
correct
Interesting
Okay, well now knowing this, it brings other ideas to the table lol.
@EventHandler(ignoreCancelled = false)
public void onQuit(EntityResurrectEvent event) {
System.out.println("uncancelled death");
event.setCancelled(false);
}
it even shows the totem animation
Hello, how can I move exactly a ItemDisplay like this using translation ?
(Black dot is where I want the ItemDisplay to be)
Neat
what is the red thing and the circle and the arrow lol
the circle is the player, the arrow is the player direction, and the red thing the translation

with a piece of shit coming out of the behind
Men do poop
its just getDirection().multiply(-0.5)
I can confirm
thanks
I was doing
itemDisplay.getTransformation().getTranslation().set(player.getLocation().getDirection().multiply(-1).toVector3f());
im currently trying to unit test my plugin.
now some parts of my code use this
Bukkit.getServicesManager().load(...);
and when trying to unit test this I get a NPE because the server is actually not started yet
also I cant mock it because its a static method
that should work fine in mockbukkit
ok thanks
also otherwise you can just do getServer().getServicesManager() if you got issues with static methods
everything that's in bukkit is basically just calling getServer()
well...
looks like not far enough back
player.addPassenger(player.getWorld().spawn(player.getLocation(), ItemDisplay.class, (itemDisplay) -> {
itemDisplay.setItemStack(previous);
itemDisplay.getTransformation().getTranslation().set(player.getLocation().getDirection().multiply(-0.5).toVector3f());
itemDisplay.setRotation(player.getLocation().getYaw(), player.getLocation().getPitch());
}));```
so multiply by -0.6
with -1, it's the same
I need to include papermc repository for it in the pom.xml, but it still works for spigot aswell right?
-1 its in teh middle of the player?
idk
-0.6
player.addPassenger(player.getWorld().spawn(player.getLocation(), ItemDisplay.class, (itemDisplay) -> {
itemDisplay.setItemStack(previous);
itemDisplay.getTransformation().getTranslation().set(player.getLocation().getDirection().multiply(-0.6).toVector3f());
itemDisplay.setRotation(player.getLocation().getYaw(), player.getLocation().getPitch());
}));```
I wonder if yrou rotation is moving it around its origin
see my code
you also need paper-api on your test scope (but ofc you don't need it for anything else)
be sure to add this ABOVE your normal spigot-api declaration
<!-- Test Dependencies Start -->
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.19.2-R0.1-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.seeseemelk</groupId>
<artifactId>MockBukkit-v1.19</artifactId>
<version>2.145.0</version>
<scope>test</scope>
</dependency>
<!-- Test dependencies end -->
General programming question here, what is the most effiecient way to store a large nested list of strings. Basically I'm working on a video player project and I made the code neccessary to convert each frame into a list of material names (ie COBBLESTONE, COAL_BLOCK etc). So i can convert each frame of a video to a list of blocks which I can display in minecraft and Ive already got it working in game with images. But how can i efficiently load an entire video of frames to memory and also should I just store this information in a yml file or something else? I can't get 20 fps without preloading the frames because the conversion process from an image to the list of blocks is about 200ms.
ok thanks
1.19.2 was the highest supported version when I last checked (although 1.19.4 was already existing back then)
because of paper's shitty new paper-plugin.yml stuff, they are/were still on 1.19.2 in mockbukkit
so, what do I need to do
what does it do if you don;t set the rotation?
this
so no different
We need to move the itemdisplay using the red line
whats it look like from above?
does it look the same from above when you do -1?
Itβs possible the direction vector has a weird length
Try normalizing it before you multiply
it's the same so yes
Does anyone know how I can add support for relative positions in a command? I got it working where I specify a number, but I'm not sure how to make it so I can do something like /setlocation ~ ~5 ~
@eternal oxide @young knoll
@NotNull
public Vector3f toVector3f() {
return new Vector3f((float) x, (float) y, (float) z);
}```
thats the method in Spigot?
yes
you must be setting the translation somewhere else then as moving the offset worked before
oh you are not setting the transformation back
(and setting after)
player.addPassenger(player.getWorld().spawn(player.getLocation(), ItemDisplay.class, (itemDisplay) -> {
itemDisplay.setItemStack(previous);
itemDisplay.getTransformation().getTranslation().set(player.getLocation().getDirection().normalize().multiply(-1).toVector3f());
}));```
@eternal oxide
Yeah you need to get the transformation, modify it, and then setTransformstion
yes you need to store teh transformation, modify it and set it back
the wiki doesnt say anything but shouldnt there be any @ExtendWith for MockBukkit?
if it was only this, I'll punch myself
-1 is a little too big
@eternal oxide
I assume ItemDisplay is a 1.20 thing?
1.19.4
ItemDisplay, BlockDisplay, and TextDisplay
ItemDisplay is the most incredible
yeah I saw the text one but didnt know about the other ones
with only this :```java
public class CustomBlock {
public CustomBlock(JavaPlugin plugin, ItemStack itemStack, Location location) {
Objects.requireNonNull(location.getWorld()).spawn(location, ItemDisplay.class, (itemDisplay -> {
itemDisplay.setItemStack(itemStack);
itemDisplay.setItemDisplayTransform(ItemDisplay.ItemDisplayTransform.HEAD);
itemDisplay.setTransformation(new Transformation(new Vector3f(0, 0, 0), new AxisAngle4f(0.0f, 0.0f, 0.0f, 1.0f), new Vector3f(1.0002f, 1.0002f, 1.0002f), new AxisAngle4f(0.0f, 0.0f, 0.0f, 1.0f)));
itemDisplay.setBrightness(new Display.Brightness(15, 15));
new BukkitRunnable() {
@Override
public void run() {
itemDisplay.setBrightness(new Display.Brightness(itemDisplay.getLocation().getBlock().getLightFromSky(), itemDisplay.getLocation().getBlock().getLightFromSky()));
}
}.runTaskTimer(plugin, 1L, 20L);
}));
}
}

yeah they are, check out this #help-development message
blockdisplays will be great for decoration and stuff
like furniture etc
itemDisplay*
for using customModelData
yeah
omg thats awesome
And text displays are just better holograms
with -0.5
better
public class HoloEntity {
public ALOT main;
public Entity hologram;
public @Nullable LivingEntity attached;
public HoloEntity(ALOT main, Location location, String text) {
this(main, location, text, null);
}
public HoloEntity(ALOT main, Location location, String text, @Nullable LivingEntity attached) {
this.main = main;
if (bukkitVersion.minor() > 19 || (bukkitVersion.revision() == 4 && bukkitVersion.major() == 19)) {
this.hologram = Objects.requireNonNull(location.getWorld()).spawn(location, TextDisplay.class, (textDisplay) -> {
textDisplay.setText(text);
textDisplay.setBillboard(Display.Billboard.CENTER);
textDisplay.getPersistentDataContainer().set(main.hologramKey, PersistentDataType.INTEGER, 1);
if (attached != null)
textDisplay.getPersistentDataContainer().set(main.healthbarKey, PersistentDataType.STRING, attached.getUniqueId().toString());
});
} else {
this.hologram = Objects.requireNonNull(location.getWorld()).spawn(location, ArmorStand.class, (stand) -> {
stand.setInvisible(true);
stand.setInvulnerable(true);
stand.setGravity(false);
stand.setMarker(true);
stand.setCustomNameVisible(true);
stand.setCustomName(text);
stand.getPersistentDataContainer().set(main.hologramKey, PersistentDataType.INTEGER, 1);
if (attached != null)
stand.getPersistentDataContainer().set(main.healthbarKey, PersistentDataType.STRING, attached.getUniqueId().toString());
});
}
this.attached = attached;
}
public void deleteAfter(long ticks) {
deleteAfter(ticks, null);
}
public void deleteAfter(long ticks, @Nullable BukkitTask task) {
new BukkitRunnable() {
@Override
public void run() {
hologram.remove();
if (task != null) task.cancel();
}
}.runTaskLater(main, ticks);
}
}```
yes, but not that
need a translation to the left-bottom
from red to green
@eternal oxide ?
well, hum
I'm going to sleep, that's all for this night
reduce the +1 on Y
it looks liek you actually want to flip it so the handle is up
?xy
Asking about your attempted solution rather than your actual problem
Pretty sure there is a getter
wot about this
can also do serverLevel() to directly get a ServerLevel
that's probably the portalCOoldown nbt tag
why don't you set it to the existing cooldown
whats the existing cooldown
portalCooldown?
Anyone have any input on this?
do you run into any issues right now by just using a list of materials?
because if not, I wouldnt worry about it
I haven't actually gotten to the point of loading a whole video, Do you think loading it as a nested list is the best way?
Wdym by "nested"?
as I said, I wouldn't worry over what's the "best" way if the current way is working fine lol
Like a list of lists of Strings, each frame is a list of strings and i need to load a list of frames
how many pixels / blocks does one frame have?
I would probably create a class Frame that holds a Material[][] array, then the whole video is a List<Frame>
i mean there isn't really any benefit in using a list, your frames will all be of the same size
When one frame has multiple materials and you have a list of frames then why do you need a two dimensional array?
public class Frame {
Material[][] pixels = new Material[width][height];
well x,y
that's what I assumed
Yeah that's true, I'm just worried about how much memory It will need to have the whole video loaded
idk
enum references are tiny
it's just a pointer basically
a memory address
you can't really make it any smaller than having a Material[][]
Each frame is 380x120 pixels and a 3 minute video is about 4000 frames at 20 fps
Pretty sure a reference is usually 32 bits
Unless you have a big heap in which case itβll go to 64 bits
182.400.000 material references then
that'd be like 1.25gb in total
ig that's not that bad
You could also make a buffer and preload a few frames before you start playing and then while playing you load the rest and remove the already rendered pixels
Like every video player basically
cool
Do you know of any sources that cover this topic so I could learn how to do that?
or did I calculate wrong?
one reference = 8 bytes
380*120 = 45600 references per frame
3 minutes * 20 fps = 3600 frames
3600* 45600 * 8 = 164160000 bytes
which is 1251.25mb
you could ofc make this smaller by using shorts or ints and mapping them to a material during the time you need it
e.g. instead of Material[][] you could have short[][]
I mean there's probably some paper for it but it really isn't that complicated
does hypixel have its own bukkit fork ?
Do you think it's even worth making a buffer or should I just load the whole video?
You can easily map the entire material enum with shorts
Is it a public plugin or for yourself?
what the fuck is happening rn
You can just use the ordinal value
It may be a public plugin eventually
then you'd be down to 2 bytes, so your 3 minute video is only using 300mb. then you got a Map<Short,Material> to convert that to the correct Material everytime you need it @unkempt peak
well in that case I'd start with just loading it completely and finishing everything else. Then before release you can still insert the buffer
but how's that gonna work if one frame takes 200ms
Yeah that's probably what I'll do
I think they mean start with just loading it all to memory for now and make a buffer later
Well would need to adjust the buffer size depending on the video length
Or optimize the 200ms ofc
as said, I'd just load it completely using a List<Frame> where Frame got a short[][] for the pixels, and a static Map<Short,Material> to translate it back to materials. 300mb for 3 minutes, that's not worse than any other uncompressed video codec
DOES hypixel have its own bukkit fork?
300mb is fine. 1.2gb is pretty rough for a public plugin that might be run on one of those 2gb vservers
Yes
do we know the name or anything about it
No
it's not public
no shit
wdym?
Material.values[short]
Well why do you need a name then? They can call it "Carlos" and it won't help you at all to know that
Ok thank you guys for all the input, I appreciate it
oh yeah if you cache that, it'll be fine
when i ask a question please answer it if you know the answer. dont make me ask 5 more questions and answer some of yours before i get to the answer
we answer whomever we wanna answer
Sometimes you gotta ask questions to fully understand what the other person actually wants to achieve
But sure, I'll just not answer you at all if unsure, don't worry
this question is not changing thw answer at all
the name is indeed carlos
Nobody knows the name of the fork aside from those that work at the company. Everything is under NDA
And like Fabsi said, even if you knew it, it wouldn't really help you in any way.
The fork isn't public. It's privately maintained
it might be for research reasons... why do you need to know why i want the answer
I don't need to know. I don't care at all why you want to know. I'm just informing you that you will not find out
Probably
No reason to give it a fancy name
well their bungee fork is called "Hypixel BungeeCord (1.3.22)" lol
Then an educated guess would be just Hypixel Spigot, yeah
i will still refer to it as carlos
Carlos sounds better
who even maintains it admins never talk about the forks at all and most devs only work on skyblock (admins are also developers)
agreed, carlos all the way
prolly something like redisbungee
Administrators aren't developers. Though like I said, things are under NDA. They can't speak about it
the maintainer's name is carlos too
The developers as a collective whole probably maintain it
Adding things as they need to, updating as necessary
In fact they only hire devs that are legally named carlos
Must have been written in fine print
rumors say it's also possible to join their team if your second name is carlos
in their nda it makes them refer to everything relating to hypixel as carlos
even themself
That must be extraordinarily confusing
yo carlos we working on carlos and carlos later tocarlos
Now I feel like naming the next plugin I release "Carlos" for no reason at all
Carlos API
Wasn't Carlos the name of the reward Creeper on Mineplex?
Oh it was Carl
I was close
His full name was probably Carlos
carl is short for calos
Maybe Carlos was his last name.
Carl Carlos
carl(os) carlos
Must have on every server
I'm planning to make a testserver for the Engine/API I'm currently working on. If you release that I'll place Carlos in the center of the Demo-Area
/bal
You have 27.3 carlos coins
Carlos joined the game
/tpa carlos
Carlos was shot by Carlos using Carlos
CarlosMC
You got no Carlos to use Carlos
hmmm Carlos is a portuguese restaurant in my city
Okay new plugin time
anyone living near mΓΌnster and wanna go to Carlos with me next weekend?
no, not just the username. replace all the players with carlos
Sure why not
like, their skin too, and their behaviour
Tablist full of carlos
Also on creeper explosions they shouldn't destroy everything and instead just place a Carlos on the point of "impact"
Can't wait to have a bunch of Carlos' in my survival world
Carlos
Dear god obfuscation is cursed
That's the only reasonable obfuscation for spigot plugins
fixed
lol the AtomicReference
everything's like carloscarloscarloscarloscarlos x 1000
except that
the atomic is just called "carlos" lmao
why isn't "stringBuilder" obfuscated? Atleast rename it to carlosBuilder
damn, carlos@carlos.net is already gone
What will it do though?
"There isn't a perfect answer to your question. However you can't go wrong with Carlos"
Carlos the new spigot mascot
give it 2 days and conclure will be talking about the "carlos anti pattern" or sth
carlos is the total opposite of an anti pattern
one could consider that violating the carlos principle is an antipattern
"dude why is your class called 'freezecommand'? It should be called CarlosCommand"
Yeah typical beginner programming mistake - one should know about the carlos principle
sorry to interupt your carlosing but whats the best/easiest method of having variables for players like kills or whatever thats easy to constantly change the value of?
and why am i still banana robot
PDC
Right, why aren't you carlos?
fr
I'd definitely use the PersistentDataCarlos for stuff like that
Oh yeah I need to work on that offline player api
Would it be reasonable to name the "EventEngine" I'm working on Carlos?
I mean it's in order to have fully ingame customizable Challenges/Settings/Events per Region which can be added via creating a plugin based on the API.
Might aswell name it Carlos.
go for it
anyway PDC is really long and i dont like it so is there something i could do to make my own custom thing so like player.setVariable would run the PDC stuff
Well extension functions aren't a thing in java. You'd have to use Kotlin.
You can of course create helper methods and call playerPdcHandler.setVariable(player, variable, value)
wdym it's long?
public final class PDC {
public static interface Type<P,C> extends PersistentDataType {}
public static <T> void set(Player player, String key, Type<?,T> type, T value) {
player.getPersistentDataContainer().set(NamespacedKey.fromString(key, myPlugin), type, value);
}
public static <T> T get(Player player, String key, Type<?,T> type) {
return player.getPersistentDataContainer().get(NamespacedKey.fromString(key, myPlugin), type);
}
}
just write a utils method for getting/setting that auto creates the key, and extend PersistentDataType to use a shorter name
then use it like this
PDC.set(player, "age", PDC.Type.INTEGER, 27);
int age = PDC.get(player, "age", PDC.Type.INTEGER);
thank god
ok i was gonna have chatgpt make it but i guess that works
lmao
me gusta
Not bad considering chatgpt doesnβt really know what carlosify means
I'll go back to university and study Carlosophy
chatgpt actually goes crazy with basic stuff like i converted skript to java in 2 seconds
what about your CS (carlos science) degree?
to be fair, neither do I
it does not
well then fix the method signature
change DataType<?,T> to PersistentDataType<?,T> in the set and get method's signature
works fine
o
is it wise to do this?
@EventHandler
public void onPlayerJoin(PlayerJoinEvent e) {
Player player = e.getPlayer();
if (manager.hasData(player).join()) {
manager.loadData(player);
} else {
manager.createData(new GenPlayer(player));
}
}``` each `manager` execution is a `CompletableFuture` in this situation
so 2 threads per join
i dont imagine it's a huge deal
If manager is backed by a FileConfiguration that file is held in memory anyway. Therefore the hasData can be done without a completable future.
its sql
But generally speaking, no it's not a huge deal.
@Override
public CompletableFuture<PlayerData> loadData(@NotNull Player key) {
return CompletableFuture.supplyAsync(() -> {
String SQL = "SELECT * FROM players WHERE uuid=?";
try (Connection conn = connection.getConnection().join()) {
PreparedStatement statement = conn.prepareStatement(SQL);
statement.setString(1, key.getUniqueId().toString());
try (ResultSet result = statement.executeQuery()) {
if (result.next()) {
UUID uuid = UUID.fromString(result.getString("uuid"));
Player player = Bukkit.getPlayer(uuid);
PlayerData data = new GenPlayer(player);
SQLStorage.getDataMap().put(uuid, data);
return data;
}
}
return null;
} catch (SQLException e) {
e.printStackTrace();
return null;
}
}).exceptionally(e -> {
throw new RuntimeException("There was an error loading data", e);
});
}```
alr
If you're working with CF, join() is pretty much a no-go
okay
You're going to thread block which completely negates the purpose of CFs
so what should i use instead?
Thereβs an async pre login event which is good for loading data
^
Don't have to use CFs at all in that situation, or at least it's fine to .join()
async code, but synchronously waiting for it to finish 
Why does the .join() Method even exist when it's blocking? Why would I even use a CompletableFuture then?
you know what u get when u rearrange Corals?... Carlos
everything leads back to Carlos
Hello! Is there like a unique way to get the Directional BlockData of a block? I'm getting a cast exception when I try to cast the BlockData of a Sign block to Directional.
event.getBlock().setType(Material.OAK_SIGN);
Directional dir = (Directional) event.getBlock().getBlockData();
dir.setFacing(event.getPlayer().getFacing().getOppositeFace());
And here's the cast exception:
java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_20_R1.block.impl.CraftFloorSign cannot be cast to class org.bukkit.block.data.Directional (org.bukkit.craftbukkit.v1_20_R1.block.impl.CraftFloorSign and org.bukkit.block.data.Directional are in unnamed module of loader java.net.URLClassLoader @2b05039f)
``` Surely the sign block's BlockData can be casted to Directional, right?
Hello! ...Who? lol
Sometimes you need to wait for a result. Sometimes you have the resources to wait until an asynchronous process completes
What is the three letter abbreviation for the Addressing mode of the instruction "coma" in assembly?
I thought it was IMM but it's not
Couldn't you not use the future then? Or is it to not duplicate a function?
What if it's not your library?
Makes sense I guess
Even if it was yours, it's probably reasonable to not create a seperate function just to call it with a completeable future
Ye just make a single one and use get when you can afford to block
I'm wanting to periodically run something specifically while a block is loaded (or alternatively identify the amount of time that given block has been loaded since a certain point in time) - is that any realistic or should I look for a different approach?
what do you mean by "while the block is loaded"? The block being in a loaded chunk?
yes
You can use the ChunkLoadEvent and unload event
mmm alright
then you can keep track of the ChunkLoad And ChunkUnloadEvent and start/stop your scheduler. If you have multiple blocks you can keep the scheduler running and iterate a list with currently loaded blocks
How can I make it so players can toggle whether they want blocks to stack or not with Rose Stacker?
How can you check if a player sets a banner inside a loom. When an InventoryInteractEvent triggers, would you just check the position the banner is supposed to be in the loom, and if its there?
Anyone experienced with changing the display name above a player's head using packets? Looking to not use a scoreboard solution due to conflicting plugins
1.19.3 * . NameTagApi has not been updated to this version
Does every mob in minecraft have a UUID? and the LivingEntity does that consist of every assumed to be alive entity? E.g. Villagers, cats, wolfs, etc.
probably
From net.md_5.bungee.api.ChatColor (not org.bukkit.ChatColor), is it possible to get the char that is associated with any given ChatColor?
I know that bukkit's ChatColor.WHATEVER has the .getChar() method, but how can I get it from a bungee ChatColor?
is there any chance i can connect my spigot servers & my bungeecord so i can get my bungeecord playerdata on my spigot server, like an API?
?jd-bcc 1 sec
ChatColor#getByChar?
I think I need the opposite of that
This returns a ChatColor given it's char (i.e. k)
I need a thing that given a (bungee) ChatColor, returns the char
(I.e. given ChatColor.MAGIC, returns k)
ah
so it looks like .toString() /should/ return something close, the docs say formatting code char + color code char
so u would just need to .substring(1)
maybe itd be a neat idea to PR a method to the api such as .getChar() or .getCode(), hmm
Ah, alright; I'll do this, thanks <3
can you edit an enum?
like ENUM("message")
can i edit the string?
and will it save
i've too lazy to try it myself
xD
hmm alr
would it be wise to make enums store my config messages?
just makes the code look cleaner to me
config messages?
oh
just read the config in the enum constructor
then you dont need to pass it in the params
so i can do Messages.SOMETHING
wait nvm wont work since itll initiate before the plugin does
just use getter setter on the variable and change it
like this?
enum Messages {
MESSAGE("message");
String message;
Messages(String message) {
this.message = message;
}
public void setMessage(String message) {
this.message = message;
}
}```
which would require a get method
but
if im understanding you correctly
enum Message {
MESSAGE;
String message;
public void setMessage(String message) {
this.message = message;
}
}
public class YourPlugin{
for(Message msg : Message.values()){
String configValue = //load form config
nsg.setMessage(configValue)
}
}
no point having the value in the constructor if you're gonna load over it
unless you want a default
yeah its clean
alr
The way to make an enum value change is make the enum hold an object. If its a string like you have above you cant change it unless you use reflection and you have to change it before the enum class loads. Enums are static final
How do you find the specific spot in an inventory? Looking to see if a banner is placed in a loom in the banner slot
get the PlayerInventory and im sure there is a #getSlot() method
its an array right? how do you know which position is which?
there is a pattern
you can print the slot to the console every time you click
debug
Hi, something to ask im making this code
https://paste.md-5.net/kaxefesixa.cs
Something im asking how can i check when the player removes the pickaxe from his inventory so that way i can remove the levels from exp bar.
Context: im making this pickaxe level system that uses the exp bar to show how many level you have, i need only to save in an hashmap and then removes but how can i check that
Oh fair. I think I'm just going to check that the players cursor is empty. With my other check, it'll only trigger when the player clicks inside a loom with a banner and when after the click the cursor is empty. I think theres only one slot in a loom that can happen lol
how does itemadders do their black screen when u load the texture pack
what black screen? Do you mean when it load? From what I know and understand buying it, places black concrete for making the player not load entities that only the player can see
i mean on join i wanna make sum that shows 100% a black screenw iwth a custom img i set in the middle and ima kinda lost
that's even easier, when loading the texture Minecraft substitutes the old texture from the ones of the server and it substitutes immediately the ones for the loading screen
no like when they login i want it to display the img until they click e
https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/resource-packs/resource-pack-discussion/1249576-changing-loading-screen-mojang-screen here the "mini tutorial" of what texture you need to modify
what are you talking CosmeticCore?
im confused because never heard other than cosmetic core having this feature
what i want to add is when a user joins my server it shows 100% a blackscreen with a img i set in the middle
im talking about making sum like it but dont know what docs to look into
so you do it with texture in the loading screen
Ended up just making this extension property (yes, my project is kotlin :p) ```kotlin
val ChatColor.char: Char
get() = this.name.last()
I'm trying to understand but its hard, the only thing from itemsadder that are this way are only this
only cosmetic core has this feature of clicking in a "gui sort"
hello im trying to make when a tnt is exploded the block that tnt blow will become fallingblock and get lauched
@EventHandler
public void onExplode(EntityExplodeEvent event) {
for (Block b : event.blockList()) {
float y = (float) -2 + (float) (Math.random() * (2 - - 2) +(1));
FallingBlock fallingBlock = b.getWorld().spawnFallingBlock(
b.getLocation(), b.getType(), b.getData());
fallingBlock.setDropItem(false);
fallingBlock.setVelocity(new Vector(0, y, 0));
}
}
}
``` end
this is my currently code
but it didnt work
how is it hard to understand wanting to show a user a 100% black screen and a img in the middle on join until they hit e
ok, so make a texture of a black tile, if you know how i hope, then put it inside a gui, done
Player p = (Player) e.getWhoClicked();
if (e.getClickedInventory().getType() == InventoryType.LOOM) {
Inventory loomInventory = e.getClickedInventory() ;
ItemStack bannerItem = e.getCursor();
p.sendMessage("Clicked Inside Loom");
if ((Tag.BANNERS.isTagged(bannerItem.getType())) && !(p.getItemOnCursor().equals(bannerItem))) {
p.sendMessage("Banner Clicked Inside Loom?");
}
}
The second if is not triggering. I know the logic doesn't make sense reading it again. How can I check the initial click, and then check the next check? I guess with persistantDataHolder? Since the first click is a different event from when it places.
again tghat would bypass minecrafts limit and it would show as a []
HHHHHHHELP AAAA dies
sorry what version are you using?
or use custom characters to help you done that
and again im thinking you are taking inspiration from here
ok and there are no limits
i cant get it to cover the screen
you can't infact most textures puts something into the player with nms like a pumkin, if you have a minigame server its better, i imagine they do this because then there are no explanation on how
When a InventoryInteractEvent triggers, is it possible to see what was placed down? I see you can see what's on the cursor, but I want to know what was placed down.
Could it be that the cursor is the item that got placed down in the first place?
?jd-s for me
have u considered maybe its BlockExplodeEvent
buuut primed tnt is a entity right?
The event fires with all its data "before" its set
a tile entity :P
Oh really?
(i think)
So if you're putting an item in an empty inventory, the inventory will be empty and the cursor will be your item
If you're shift-clicking, your cursor is empty and your item is your event's currentItem
cursor = item that's held
currentItem = item in the clicked slot
What happens when the item doesn't land? Such as trying to put an item into an output spot?
hm maybe it is Entity cos of what TNTPrimed extends.. idk
Because that still triggers this of course:
if ((Tag.BANNERS.isTagged(bannerItem.getType()))) {
I believe the event still fires and all the logic is handled after by nms
But honestly that's like the one question I can't answer here immediately so let me check internals
Lol ok. I was thinking I could check the current hand on the player, and see if it wasn't the item that was fired with the event (implying it is no longer in the hand), but I couldn't get that working
Hghhhghhhghh
ugh it's buried somewhere
You
oh? So I would need to check the slot they try to place the item on
This is the nms slot
I'm not familiar with nms, I know it's like the internals, would I need to utilize that? I may not be experienced enough to make that work.
No, you wouldn't
ah ok cool
Ok thanks I'll check that
I get the type of placement regardless of success, not very useful unfortunately
so right click on pickup is pickup_half, left click normally is place_all
I could try doing some logic with the slot type maybe. Since result slot and crafting slot are different. I wonder if I need to iterate over the crafting slots of the loom and see if one has the banner
getting closer
if ((Tag.BANNERS.isTagged(bannerItem.getType())) && e.getSlotType().equals(InventoryType.SlotType.CRAFTING)) {
Bukkit.getLogger().info(e.getAction().toString());
}
Won't trigger from the output box. Unfortunately it still triggers on the crafting slots that the banner can't go in.
i have this code - armorStand.getWorld().createExplosion(armorStand.getLocation(),explore_power); - how get player who take damage
listen for entitydamageevent
if (e.getClickedInventory() != null) {
if (e.getClickedInventory().getType() == InventoryType.LOOM) {
Inventory loomInventory = e.getClickedInventory();
ItemStack bannerItem = e.getCursor();
if ((
Tag.BANNERS.isTagged(bannerItem.getType())) &&
e.getSlotType().equals(InventoryType.SlotType.CRAFTING) &&
loomInventory.getItem(e.getSlot()) == bannerItem) {
Bukkit.getLogger().info(e.getAction().toString());
}
}
}
I'm 99% sure that loomInventory.getItem(e.getSlot()) == bannerItem shows as empty always, since this this is running before the item is processed from the cursor into the slot. Does anyone have an idea on how to accomplish what I'm trying to do? Is there an event that triggers when an item enters a crafting inventory slot? I'm guessing I need to catch whatever event happens next to get the data of if the banner is in the slot or not. This ultimately comes from the need to confirm the banner was placed in the slot.
im running a task async every 1 tick, and im trying to get the levels from the pickaxe "custom" and display them into the exp bar but for some reasons it gives me 0.0 EXP and the exp is same level and it doesn't get displayed
https://paste.md-5.net/ahasapofet.cs
Why is that task async lol
idk async = better
Haha no
i know sometimes async = bad but for the meme
ok now how get explore location if explore do not entity
in ur case its pretty damn useless
changing it but for the real answer why the exp removed is not removed?
EXP is a normal hashmap?
yes an hasmap with UUID and float
I hate dat files and 100% regret working them π
isn't that just NBT ?
oh idk ive never touched that. not yet at least. im serializing data into dats
when it comes to debugging and checking if the data is actually in it. comes a challenge since you cant read it lol.
if it actually is nbt, then just use NBT explorer
Nbt explorer
its not
Smh
i fixed the levels problem but now the exp gets saved the one from the pickaxe and not the one from the player
https://paste.md-5.net/zivigofica.cs
example
Pickaxe has 200EXP
Player has 20EXP
the player when removing the pickaxe gets the 200 and not the 20 he had originally
On the first tick you set the EXP to the hashmap correctly - the current players xp
But the very next tick, you replace that value with player XP, which is now the pickaxe XP
Adding EXP.contains(uuid) before adding the to the map should fix that
if(!EXP.containsKey(player.getUniqueId())) EXP.put(player.getUniqueId(), Exprience.getExp(player));
only this line should fix everything
Maybe
works just fine
lmao what
i dont know
for every new class i try to make
it says this
nvm fixed it. jre got deselected in build path? XD had to reselect it
loool

Ru u using like java 3 or sth?
eclipse moment
π₯²
something with math im trying to do,
same code as before for the experience but now i need
if a player sets the config every 1000 blocks are 1 level of exp, how can i calculate exp correctly to then every 1000 blocks give a level?
(this doesn't not depends from minecraft levels experience like every 200000 exp is equals to some level but its forced but should show correctly inside the bar if i have 200 blocks remain it should show like it)
i need anti loot blowup plugin plz help
meaning end_crystals do not blow up the loot when you kill somebody
Wrong channel ask in #help-server
do you have it?
Hi,
How should I do to update the scoreboard of a player ?
Like it has a Money value that goes from :
Money : 3 To Money : 4
is there anyway to get inventory of a chest without using BlockState?
NMS inventory also does it
edit the scoreboard, and apply to player